diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index b15e67ffa..1e9f2f7a2 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -94,7 +94,7 @@ namespace MediaBrowser.Api var item = _dtoService.GetItemByDtoId(request.ItemId); var newLockData = request.LockData ?? false; - var dontFetchMetaChanged = item.DontFetchMeta != newLockData; + var dontFetchMetaChanged = item.IsLocked != newLockData; UpdateItem(request, item); diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 5f86c71ec..1001980ec 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1308,9 +1308,9 @@ namespace MediaBrowser.Api.Playback RequestedUrl = url }; - var item = string.IsNullOrEmpty(request.MediaVersionId) ? + var item = string.IsNullOrEmpty(request.MediaSourceId) ? DtoService.GetItemByDtoId(request.Id) : - DtoService.GetItemByDtoId(request.MediaVersionId); + DtoService.GetItemByDtoId(request.MediaSourceId); if (user != null && item.GetPlayAccess(user) != PlayAccess.Full) { diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs index 89e38711f..df52e5e3e 100644 --- a/MediaBrowser.Api/Playback/StreamRequest.cs +++ b/MediaBrowser.Api/Playback/StreamRequest.cs @@ -15,8 +15,8 @@ namespace MediaBrowser.Api.Playback [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public string Id { get; set; } - [ApiMember(Name = "MediaVersionId", Description = "The media version id, if playing an alternate version", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] - public string MediaVersionId { get; set; } + [ApiMember(Name = "MediaSourceId", Description = "The media version id, if playing an alternate version", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + public string MediaSourceId { get; set; } [ApiMember(Name = "DeviceId", Description = "The device id of the client requesting. Used to stop encoding processes when needed.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public string DeviceId { get; set; } diff --git a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs index 5173008f9..c6051c02c 100644 --- a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs +++ b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs @@ -241,8 +241,8 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public string Id { get; set; } - [ApiMember(Name = "MediaVersionId", Description = "The id of the MediaVersion", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")] - public string MediaVersionId { get; set; } + [ApiMember(Name = "MediaSourceId", Description = "The id of the MediaSource", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")] + public string MediaSourceId { get; set; } /// /// Gets or sets a value indicating whether this is likes. @@ -280,8 +280,8 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public string Id { get; set; } - [ApiMember(Name = "MediaVersionId", Description = "The id of the MediaVersion", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")] - public string MediaVersionId { get; set; } + [ApiMember(Name = "MediaSourceId", Description = "The id of the MediaSource", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")] + public string MediaSourceId { get; set; } /// /// Gets or sets the position ticks. @@ -318,8 +318,8 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public string Id { get; set; } - [ApiMember(Name = "MediaVersionId", Description = "The id of the MediaVersion", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")] - public string MediaVersionId { get; set; } + [ApiMember(Name = "MediaSourceId", Description = "The id of the MediaSource", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")] + public string MediaSourceId { get; set; } /// /// Gets or sets the position ticks. @@ -746,7 +746,7 @@ namespace MediaBrowser.Api.UserLibrary Item = item, SessionId = GetSession().Id, QueueableMediaTypes = queueableMediaTypes.Split(',').ToList(), - MediaVersionId = request.MediaVersionId + MediaSourceId = request.MediaSourceId }; _sessionManager.OnPlaybackStart(info); @@ -769,7 +769,7 @@ namespace MediaBrowser.Api.UserLibrary IsMuted = request.IsMuted, IsPaused = request.IsPaused, SessionId = GetSession().Id, - MediaVersionId = request.MediaVersionId + MediaSourceId = request.MediaSourceId }; var task = _sessionManager.OnPlaybackProgress(info); @@ -794,7 +794,7 @@ namespace MediaBrowser.Api.UserLibrary Item = item, PositionTicks = request.PositionTicks, SessionId = session.Id, - MediaVersionId = request.MediaVersionId + MediaSourceId = request.MediaSourceId }; var task = _sessionManager.OnPlaybackStopped(info); diff --git a/MediaBrowser.Api/VideosService.cs b/MediaBrowser.Api/VideosService.cs index 380f89bc7..94432871c 100644 --- a/MediaBrowser.Api/VideosService.cs +++ b/MediaBrowser.Api/VideosService.cs @@ -27,8 +27,8 @@ namespace MediaBrowser.Api public string Id { get; set; } } - [Route("/Videos/{Id}/AlternateVersions", "DELETE", Summary = "Assigns videos as alternates of another.")] - public class DeleteAlternateVersions : IReturnVoid + [Route("/Videos/{Id}/AlternateSources", "DELETE", Summary = "Removes alternate video sources.")] + public class DeleteAlternateSources : IReturnVoid { [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public string Id { get; set; } @@ -95,14 +95,14 @@ namespace MediaBrowser.Api return ToOptimizedSerializedResultUsingCache(result); } - public void Delete(DeleteAlternateVersions request) + public void Delete(DeleteAlternateSources request) { var task = RemoveAlternateVersions(request); Task.WaitAll(task); } - private async Task RemoveAlternateVersions(DeleteAlternateVersions request) + private async Task RemoveAlternateVersions(DeleteAlternateSources request) { var video = (Video)_dtoService.GetItemByDtoId(request.Id); @@ -143,7 +143,7 @@ namespace MediaBrowser.Api var videos = items.Cast /// The media version identifier. - public string MediaVersionId { get; set; } + public string MediaSourceId { get; set; } } } diff --git a/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs b/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs index 0c825932c..3d402aa6f 100644 --- a/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs +++ b/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs @@ -39,6 +39,6 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the media version identifier. /// /// The media version identifier. - public string MediaVersionId { get; set; } + public string MediaSourceId { get; set; } } } diff --git a/MediaBrowser.Controller/Session/PlaybackStopInfo.cs b/MediaBrowser.Controller/Session/PlaybackStopInfo.cs index 3391c96cf..063abf78c 100644 --- a/MediaBrowser.Controller/Session/PlaybackStopInfo.cs +++ b/MediaBrowser.Controller/Session/PlaybackStopInfo.cs @@ -27,6 +27,6 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the media version identifier. /// /// The media version identifier. - public string MediaVersionId { get; set; } + public string MediaSourceId { get; set; } } } diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index 953d186e8..9dd57d12a 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -123,7 +123,7 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the now playing media version identifier. /// /// The now playing media version identifier. - public string NowPlayingMediaVersionId { get; set; } + public string NowPlayingMediaSourceId { get; set; } /// diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 379e757bb..780f936be 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -92,7 +92,7 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the media versions. /// /// The media versions. - public List MediaVersions { get; set; } + public List MediaSources { get; set; } /// /// Gets or sets the critic rating. @@ -500,7 +500,7 @@ namespace MediaBrowser.Model.Dto /// /// The part count. public int? PartCount { get; set; } - public int? MediaVersionCount { get; set; } + public int? MediaSourceCount { get; set; } /// /// Determines whether the specified type is type. diff --git a/MediaBrowser.Model/Dto/MediaVersionInfo.cs b/MediaBrowser.Model/Dto/MediaVersionInfo.cs index c2e0d83b2..4dfb32dd5 100644 --- a/MediaBrowser.Model/Dto/MediaVersionInfo.cs +++ b/MediaBrowser.Model/Dto/MediaVersionInfo.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; namespace MediaBrowser.Model.Dto { - public class MediaVersionInfo + public class MediaSourceInfo { public string Id { get; set; } diff --git a/MediaBrowser.Model/Entities/BaseItemInfo.cs b/MediaBrowser.Model/Entities/BaseItemInfo.cs index 0fac97949..16a08d693 100644 --- a/MediaBrowser.Model/Entities/BaseItemInfo.cs +++ b/MediaBrowser.Model/Entities/BaseItemInfo.cs @@ -74,7 +74,7 @@ namespace MediaBrowser.Model.Entities /// Gets or sets the media version identifier. /// /// The media version identifier. - public string MediaVersionId { get; set; } + public string MediaSourceId { get; set; } /// /// Gets a value indicating whether this instance has primary image. diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.cs index 65509fd6d..398be3c7b 100644 --- a/MediaBrowser.Model/Querying/ItemFields.cs +++ b/MediaBrowser.Model/Querying/ItemFields.cs @@ -84,7 +84,7 @@ namespace MediaBrowser.Model.Querying /// /// The media versions /// - MediaVersions, + MediaSources, /// /// The metadata settings diff --git a/MediaBrowser.Model/Session/PlaybackReports.cs b/MediaBrowser.Model/Session/PlaybackReports.cs index 662dc5780..75dd3346c 100644 --- a/MediaBrowser.Model/Session/PlaybackReports.cs +++ b/MediaBrowser.Model/Session/PlaybackReports.cs @@ -10,7 +10,7 @@ namespace MediaBrowser.Model.Session public string ItemId { get; set; } - public string MediaVersionId { get; set; } + public string MediaSourceId { get; set; } public bool IsSeekable { get; set; } @@ -31,7 +31,7 @@ namespace MediaBrowser.Model.Session public string ItemId { get; set; } - public string MediaVersionId { get; set; } + public string MediaSourceId { get; set; } public long? PositionTicks { get; set; } @@ -49,7 +49,7 @@ namespace MediaBrowser.Model.Session public string ItemId { get; set; } - public string MediaVersionId { get; set; } + public string MediaSourceId { get; set; } public long? PositionTicks { get; set; } } diff --git a/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs b/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs index 03fe5c802..391ab7cfd 100644 --- a/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs +++ b/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs @@ -213,7 +213,7 @@ namespace MediaBrowser.Providers.Savers builder.Append("" + SecurityElement.Escape(item.DateCreated.ToLocalTime().ToString("G")) + ""); - builder.Append("" + item.DontFetchMeta.ToString().ToLower() + ""); + builder.Append("" + item.IsLocked.ToString().ToLower() + ""); if (item.LockedFields.Count > 0) { diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 520b01af2..2c8069880 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -127,7 +127,7 @@ namespace MediaBrowser.Server.Implementations.Dto public BaseItemDto GetItemByNameDto(T item, List fields, User user = null) where T : BaseItem, IItemByName { - var libraryItems = user != null ? user.RootFolder.GetRecursiveChildren(user) : + var libraryItems = user != null ? user.RootFolder.GetRecursiveChildren(user) : _libraryManager.RootFolder.RecursiveChildren; return GetItemByNameDto(item, fields, item.GetTaggedItems(libraryItems).ToList(), user); @@ -274,7 +274,7 @@ namespace MediaBrowser.Server.Implementations.Dto if (session.NowPlayingItem != null) { - dto.NowPlayingItem = GetNowPlayingInfo(session.NowPlayingItem, session.NowPlayingMediaVersionId, session.NowPlayingRunTimeTicks); + dto.NowPlayingItem = GetNowPlayingInfo(session.NowPlayingItem, session.NowPlayingMediaSourceId, session.NowPlayingRunTimeTicks); } if (session.UserId.HasValue) @@ -290,11 +290,11 @@ namespace MediaBrowser.Server.Implementations.Dto /// Converts a BaseItem to a BaseItemInfo /// /// The item. - /// The media version identifier. + /// The media version identifier. /// The now playing runtime ticks. /// BaseItemInfo. /// item - private BaseItemInfo GetNowPlayingInfo(BaseItem item, string mediaVersionId, long? nowPlayingRuntimeTicks) + private BaseItemInfo GetNowPlayingInfo(BaseItem item, string mediaSourceId, long? nowPlayingRuntimeTicks) { if (item == null) { @@ -308,7 +308,7 @@ namespace MediaBrowser.Server.Implementations.Dto MediaType = item.MediaType, Type = item.GetClientTypeName(), RunTimeTicks = nowPlayingRuntimeTicks, - MediaVersionId = mediaVersionId + MediaSourceId = mediaSourceId }; info.PrimaryImageTag = GetImageCacheTag(item, ImageType.Primary); @@ -740,7 +740,7 @@ namespace MediaBrowser.Server.Implementations.Dto if (fields.Contains(ItemFields.Settings)) { dto.LockedFields = item.LockedFields; - dto.LockData = item.DontFetchMeta; + dto.LockData = item.IsLocked; } var hasBudget = item as IHasBudget; @@ -1046,7 +1046,7 @@ namespace MediaBrowser.Server.Implementations.Dto { dto.IsPlaceHolder = supportsPlaceHolders.IsPlaceHolder; } - + // Add audio info var audio = item as Audio; if (audio != null) @@ -1063,8 +1063,8 @@ namespace MediaBrowser.Server.Implementations.Dto dto.AlbumPrimaryImageTag = GetImageCacheTag(albumParent, ImageType.Primary); } - dto.MediaVersions = GetMediaVersions(audio); - dto.MediaVersionCount = 1; + dto.MediaSources = GetMediaSources(audio); + dto.MediaSourceCount = 1; } var album = item as MusicAlbum; @@ -1095,18 +1095,18 @@ namespace MediaBrowser.Server.Implementations.Dto dto.IsHD = video.IsHD; dto.PartCount = video.AdditionalPartIds.Count + 1; - dto.MediaVersionCount = video.AlternateVersionCount + 1; + dto.MediaSourceCount = video.MediaSourceCount; - if (fields.Contains(ItemFields.MediaVersions)) + if (fields.Contains(ItemFields.MediaSources)) { - dto.MediaVersions = GetMediaVersions(video); + dto.MediaSources = GetMediaSources(video); } if (fields.Contains(ItemFields.Chapters)) { List chapters; - if (dto.MediaVersions != null && dto.MediaVersions.Count > 0) + if (dto.MediaSources != null && dto.MediaSources.Count > 0) { chapters = _itemRepo.GetChapters(item.Id).Select(c => GetChapterInfoDto(c, item)).ToList(); } @@ -1130,9 +1130,9 @@ namespace MediaBrowser.Server.Implementations.Dto { List mediaStreams; - if (dto.MediaVersions != null && dto.MediaVersions.Count > 0) + if (dto.MediaSources != null && dto.MediaSources.Count > 0) { - mediaStreams = dto.MediaVersions.Where(i => i.IsPrimaryVersion) + mediaStreams = dto.MediaSources.Where(i => i.IsPrimaryVersion) .SelectMany(i => i.MediaStreams) .ToList(); } @@ -1267,7 +1267,7 @@ namespace MediaBrowser.Server.Implementations.Dto } } - private List GetMediaVersions(Video item) + private List GetMediaSources(Video item) { var result = item.GetAlternateVersions().Select(i => GetVersionInfo(i, false)).ToList(); @@ -1293,9 +1293,9 @@ namespace MediaBrowser.Server.Implementations.Dto .ToList(); } - private List GetMediaVersions(Audio item) + private List GetMediaSources(Audio item) { - var result = new List + var result = new List { GetVersionInfo(item, true) }; @@ -1303,17 +1303,17 @@ namespace MediaBrowser.Server.Implementations.Dto return result; } - private MediaVersionInfo GetVersionInfo(Video i, bool isPrimary) + private MediaSourceInfo GetVersionInfo(Video i, bool isPrimary) { - var mediaStreams = _itemRepo.GetMediaStreams(new MediaStreamQuery {ItemId = i.Id}).ToList(); + var mediaStreams = _itemRepo.GetMediaStreams(new MediaStreamQuery { ItemId = i.Id }).ToList(); - return new MediaVersionInfo + return new MediaSourceInfo { Id = i.Id.ToString("N"), IsoType = i.IsoType, LocationType = i.LocationType, MediaStreams = mediaStreams, - Name = GetAlternateVersionName(i, mediaStreams), + Name = GetMediaSourceName(i, mediaStreams), Path = GetMappedPath(i), RunTimeTicks = i.RunTimeTicks, Video3DFormat = i.Video3DFormat, @@ -1322,9 +1322,9 @@ namespace MediaBrowser.Server.Implementations.Dto }; } - private MediaVersionInfo GetVersionInfo(Audio i, bool isPrimary) + private MediaSourceInfo GetVersionInfo(Audio i, bool isPrimary) { - return new MediaVersionInfo + return new MediaSourceInfo { Id = i.Id.ToString("N"), LocationType = i.LocationType, @@ -1355,7 +1355,7 @@ namespace MediaBrowser.Server.Implementations.Dto return path; } - private string GetAlternateVersionName(Video video, List mediaStreams) + private string GetMediaSourceName(Video video, List mediaStreams) { var terms = new List(); diff --git a/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs b/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs index ad2db5abb..3097495e3 100644 --- a/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs +++ b/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs @@ -47,7 +47,7 @@ namespace MediaBrowser.Server.Implementations.Library EnsureName(item, args); item.DontFetchMeta = item.Path.IndexOf("[dontfetchmeta]", StringComparison.OrdinalIgnoreCase) != -1 || - item.Parents.Any(i => i.DontFetchMeta); + item.Parents.Any(i => i.IsLocked); // Make sure DateCreated and DateModified have values EntityResolutionHelper.EnsureDates(fileSystem, item, args, true); diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index d7b2b1321..13a1e8f16 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -190,7 +190,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies /// The directory service. /// if set to true [support multi file items]. /// Movie. - private T FindMovie(string path, Folder parent, IEnumerable fileSystemEntries, IDirectoryService directoryService, bool supportMultiFileItems, bool supportsAlternateVersions) + private T FindMovie(string path, Folder parent, IEnumerable fileSystemEntries, IDirectoryService directoryService, bool supportMultiFileItems, bool supportsMultipleSources) where T : Video, new() { var movies = new List(); @@ -262,9 +262,9 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies return result; } } - if (supportsAlternateVersions) + if (supportsMultipleSources) { - var result = GetMovieWithAlternateVersions(movies); + var result = GetMovieWithMultipleSources(movies); if (result != null) { @@ -393,7 +393,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies return null; } - private T GetMovieWithAlternateVersions(IEnumerable movies) + private T GetMovieWithMultipleSources(IEnumerable movies) where T : Video, new() { var sortedMovies = movies.OrderBy(i => i.Path).ToList(); diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index c89506261..9d405a175 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -218,26 +218,26 @@ namespace MediaBrowser.Server.Implementations.Session /// /// The session. /// The item. - /// The media version identifier. + /// The media version identifier. /// if set to true [is paused]. /// if set to true [is muted]. /// The current position ticks. - private void UpdateNowPlayingItem(SessionInfo session, BaseItem item, string mediaVersionId, bool isPaused, bool isMuted, long? currentPositionTicks = null) + private void UpdateNowPlayingItem(SessionInfo session, BaseItem item, string mediaSourceId, bool isPaused, bool isMuted, long? currentPositionTicks = null) { session.IsMuted = isMuted; session.IsPaused = isPaused; session.NowPlayingPositionTicks = currentPositionTicks; session.NowPlayingItem = item; session.LastActivityDate = DateTime.UtcNow; - session.NowPlayingMediaVersionId = mediaVersionId; + session.NowPlayingMediaSourceId = mediaSourceId; - if (string.IsNullOrWhiteSpace(mediaVersionId)) + if (string.IsNullOrWhiteSpace(mediaSourceId)) { session.NowPlayingRunTimeTicks = item.RunTimeTicks; } else { - var version = _libraryManager.GetItemById(new Guid(mediaVersionId)); + var version = _libraryManager.GetItemById(new Guid(mediaSourceId)); session.NowPlayingRunTimeTicks = version.RunTimeTicks; } @@ -261,7 +261,7 @@ namespace MediaBrowser.Server.Implementations.Session session.NowPlayingPositionTicks = null; session.IsPaused = false; session.NowPlayingRunTimeTicks = null; - session.NowPlayingMediaVersionId = null; + session.NowPlayingMediaSourceId = null; } } @@ -368,9 +368,9 @@ namespace MediaBrowser.Server.Implementations.Session var item = info.Item; - var mediaVersionId = GetMediaVersionId(item, info.MediaVersionId); + var mediaSourceId = GetMediaSourceId(item, info.MediaSourceId); - UpdateNowPlayingItem(session, item, mediaVersionId, false, false); + UpdateNowPlayingItem(session, item, mediaSourceId, false, false); session.CanSeek = info.CanSeek; session.QueueableMediaTypes = info.QueueableMediaTypes; @@ -390,7 +390,7 @@ namespace MediaBrowser.Server.Implementations.Session { Item = item, Users = users, - MediaVersionId = info.MediaVersionId + MediaSourceId = info.MediaSourceId }, _logger); } @@ -438,9 +438,9 @@ namespace MediaBrowser.Server.Implementations.Session var session = Sessions.First(i => i.Id.Equals(info.SessionId)); - var mediaVersionId = GetMediaVersionId(info.Item, info.MediaVersionId); + var mediaSourceId = GetMediaSourceId(info.Item, info.MediaSourceId); - UpdateNowPlayingItem(session, info.Item, mediaVersionId, info.IsPaused, info.IsMuted, info.PositionTicks); + UpdateNowPlayingItem(session, info.Item, mediaSourceId, info.IsPaused, info.IsMuted, info.PositionTicks); var key = info.Item.GetUserDataKey(); @@ -456,7 +456,7 @@ namespace MediaBrowser.Server.Implementations.Session Item = info.Item, Users = users, PlaybackPositionTicks = info.PositionTicks, - MediaVersionId = mediaVersionId + MediaSourceId = mediaSourceId }, _logger); } @@ -516,7 +516,7 @@ namespace MediaBrowser.Server.Implementations.Session playedToCompletion = await OnPlaybackStopped(user.Id, key, info.Item, info.PositionTicks).ConfigureAwait(false); } - var mediaVersionId = GetMediaVersionId(info.Item, info.MediaVersionId); + var mediaSourceId = GetMediaSourceId(info.Item, info.MediaSourceId); EventHelper.QueueEventIfNotNull(PlaybackStopped, this, new PlaybackStopEventArgs { @@ -524,22 +524,22 @@ namespace MediaBrowser.Server.Implementations.Session Users = users, PlaybackPositionTicks = info.PositionTicks, PlayedToCompletion = playedToCompletion, - MediaVersionId = mediaVersionId + MediaSourceId = mediaSourceId }, _logger); } - private string GetMediaVersionId(BaseItem item, string reportedMediaVersionId) + private string GetMediaSourceId(BaseItem item, string reportedMediaSourceId) { - if (string.IsNullOrWhiteSpace(reportedMediaVersionId)) + if (string.IsNullOrWhiteSpace(reportedMediaSourceId)) { if (item is Video || item is Audio) { - reportedMediaVersionId = item.Id.ToString("N"); + reportedMediaSourceId = item.Id.ToString("N"); } } - return reportedMediaVersionId; + return reportedMediaSourceId; } private async Task OnPlaybackStopped(Guid userId, string userDataKey, BaseItem item, long? positionTicks) diff --git a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs index 5c4c00e7d..fe32e2328 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs @@ -225,7 +225,7 @@ namespace MediaBrowser.Server.Implementations.Session if (vals.Length > 3) { - info.MediaVersionId = vals[3]; + info.MediaSourceId = vals[3]; } _sessionManager.OnPlaybackStart(info); @@ -272,7 +272,7 @@ namespace MediaBrowser.Server.Implementations.Session if (vals.Length > 4) { - info.MediaVersionId = vals[4]; + info.MediaSourceId = vals[4]; } _sessionManager.OnPlaybackProgress(info); @@ -316,7 +316,7 @@ namespace MediaBrowser.Server.Implementations.Session if (vals.Length > 2) { - info.MediaVersionId = vals[2]; + info.MediaSourceId = vals[2]; } _sessionManager.OnPlaybackStopped(info); diff --git a/MediaBrowser.Server.Implementations/Sorting/AlphanumComparator.cs b/MediaBrowser.Server.Implementations/Sorting/AlphanumComparator.cs index 39a68b3f6..b76bf0a9c 100644 --- a/MediaBrowser.Server.Implementations/Sorting/AlphanumComparator.cs +++ b/MediaBrowser.Server.Implementations/Sorting/AlphanumComparator.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Text; namespace MediaBrowser.Server.Implementations.Sorting diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js index 47719df8d..765cae612 100644 --- a/MediaBrowser.WebDashboard/ApiClient.js +++ b/MediaBrowser.WebDashboard/ApiClient.js @@ -3791,7 +3791,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi * @param {String} userId * @param {String} itemId */ - self.reportPlaybackStart = function (userId, itemId, mediaVersionId, canSeek, queueableMediaTypes) { + self.reportPlaybackStart = function (userId, itemId, mediaSourceId, canSeek, queueableMediaTypes) { if (!userId) { throw new Error("null userId"); @@ -3810,8 +3810,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi var msg = [itemId, canSeek, queueableMediaTypes]; - if (mediaVersionId) { - msg.push(mediaVersionId); + if (mediaSourceId) { + msg.push(mediaSourceId); } self.sendWebSocketMessage("PlaybackStart", msg.join('|')); @@ -3825,8 +3825,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi QueueableMediaTypes: queueableMediaTypes }; - if (mediaVersionId) { - params.mediaVersionId = mediaVersionId; + if (mediaSourceId) { + params.mediaSourceId = mediaSourceId; } var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId, params); @@ -3842,7 +3842,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi * @param {String} userId * @param {String} itemId */ - self.reportPlaybackProgress = function (userId, itemId, mediaVersionId, positionTicks, isPaused, isMuted) { + self.reportPlaybackProgress = function (userId, itemId, mediaSourceId, positionTicks, isPaused, isMuted) { if (!userId) { throw new Error("null userId"); @@ -3861,7 +3861,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi msgData += "|" + (positionTicks == null ? "" : positionTicks); msgData += "|" + (isPaused == null ? "" : isPaused); msgData += "|" + (isMuted == null ? "" : isMuted); - msgData += "|" + (mediaVersionId == null ? "" : mediaVersionId); + msgData += "|" + (mediaSourceId == null ? "" : mediaSourceId); self.sendWebSocketMessage("PlaybackProgress", msgData); @@ -3878,8 +3878,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi params.positionTicks = positionTicks; } - if (mediaVersionId) { - params.mediaVersionId = mediaVersionId; + if (mediaSourceId) { + params.mediaSourceId = mediaSourceId; } var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId + "/Progress", params); @@ -3895,7 +3895,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi * @param {String} userId * @param {String} itemId */ - self.reportPlaybackStopped = function (userId, itemId, mediaVersionId, positionTicks) { + self.reportPlaybackStopped = function (userId, itemId, mediaSourceId, positionTicks) { if (!userId) { throw new Error("null userId"); @@ -3911,7 +3911,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi var msg = itemId; msg += "|" + (positionTicks == null ? "" : positionTicks); - msg += "|" + (mediaVersionId == null ? "" : mediaVersionId); + msg += "|" + (mediaSourceId == null ? "" : mediaSourceId); self.sendWebSocketMessage("PlaybackStopped", msg); @@ -3925,8 +3925,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi params.positionTicks = positionTicks; } - if (mediaVersionId) { - params.mediaVersionId = mediaVersionId; + if (mediaSourceId) { + params.mediaSourceId = mediaSourceId; } var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId, params); diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index bbc2c0f06..7396527bb 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file