From ea9e8b957cdf5bb335967eeb1a018c4fc2a1db53 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 11 Dec 2014 01:20:28 -0500 Subject: update sync objects --- MediaBrowser.Controller/Entities/Game.cs | 13 +++++++++++++ MediaBrowser.Controller/Entities/IHasTrailers.cs | 9 ++++++++- MediaBrowser.Controller/Entities/Movies/BoxSet.cs | 13 +++++++++++++ MediaBrowser.Controller/Entities/Movies/Movie.cs | 13 +++++++++++++ MediaBrowser.Controller/Entities/TV/Series.cs | 15 ++++++++++++++- MediaBrowser.Controller/Entities/Trailer.cs | 5 +---- MediaBrowser.Controller/Entities/UserViewBuilder.cs | 2 +- MediaBrowser.Controller/Sync/ISyncManager.cs | 4 +--- MediaBrowser.Controller/Sync/ISyncRepository.cs | 15 +++++++++++++++ 9 files changed, 79 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Entities/Game.cs b/MediaBrowser.Controller/Entities/Game.cs index 062bdfa88..e4d032359 100644 --- a/MediaBrowser.Controller/Entities/Game.cs +++ b/MediaBrowser.Controller/Entities/Game.cs @@ -28,12 +28,14 @@ namespace MediaBrowser.Controller.Entities SoundtrackIds = new List(); RemoteTrailers = new List(); LocalTrailerIds = new List(); + RemoteTrailerIds = new List(); ThemeSongIds = new List(); ThemeVideoIds = new List(); Tags = new List(); } public List LocalTrailerIds { get; set; } + public List RemoteTrailerIds { get; set; } /// /// Gets or sets the tags. @@ -119,5 +121,16 @@ namespace MediaBrowser.Controller.Entities return id; } + + /// + /// Gets the trailer ids. + /// + /// List<Guid>. + public List GetTrailerIds() + { + var list = LocalTrailerIds.ToList(); + list.AddRange(RemoteTrailerIds); + return list; + } } } diff --git a/MediaBrowser.Controller/Entities/IHasTrailers.cs b/MediaBrowser.Controller/Entities/IHasTrailers.cs index 47779064b..bc1c7d875 100644 --- a/MediaBrowser.Controller/Entities/IHasTrailers.cs +++ b/MediaBrowser.Controller/Entities/IHasTrailers.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; namespace MediaBrowser.Controller.Entities { - public interface IHasTrailers + public interface IHasTrailers : IHasProviderIds { /// /// Gets or sets the remote trailers. @@ -17,5 +17,12 @@ namespace MediaBrowser.Controller.Entities /// /// The local trailer ids. List LocalTrailerIds { get; set; } + List RemoteTrailerIds { get; set; } + + /// + /// Gets the trailer ids. + /// + /// List<Guid>. + List GetTrailerIds(); } } diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs index 705cf9057..731226ede 100644 --- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -21,6 +21,7 @@ namespace MediaBrowser.Controller.Entities.Movies { RemoteTrailers = new List(); LocalTrailerIds = new List(); + RemoteTrailerIds = new List(); DisplayOrder = ItemSortBy.PremiereDate; Keywords = new List(); @@ -35,6 +36,7 @@ namespace MediaBrowser.Controller.Entities.Movies } public List LocalTrailerIds { get; set; } + public List RemoteTrailerIds { get; set; } /// /// Gets or sets the remote trailers. @@ -76,6 +78,17 @@ namespace MediaBrowser.Controller.Entities.Movies } } + /// + /// Gets the trailer ids. + /// + /// List<Guid>. + public List GetTrailerIds() + { + var list = LocalTrailerIds.ToList(); + list.AddRange(RemoteTrailerIds); + return list; + } + public override IEnumerable GetChildren(User user, bool includeLinkedChildren) { var children = base.GetChildren(user, includeLinkedChildren); diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 8ae024f37..e749d89e4 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -36,6 +36,7 @@ namespace MediaBrowser.Controller.Entities.Movies SoundtrackIds = new List(); RemoteTrailers = new List(); LocalTrailerIds = new List(); + RemoteTrailerIds = new List(); ThemeSongIds = new List(); ThemeVideoIds = new List(); BoxSetIdList = new List(); @@ -49,6 +50,7 @@ namespace MediaBrowser.Controller.Entities.Movies public float? Metascore { get; set; } public List LocalTrailerIds { get; set; } + public List RemoteTrailerIds { get; set; } public List Keywords { get; set; } public List RemoteTrailers { get; set; } @@ -89,6 +91,17 @@ namespace MediaBrowser.Controller.Entities.Movies /// The name of the TMDB collection. public string TmdbCollectionName { get; set; } + /// + /// Gets the trailer ids. + /// + /// List<Guid>. + public List GetTrailerIds() + { + var list = LocalTrailerIds.ToList(); + list.AddRange(RemoteTrailerIds); + return list; + } + /// /// Gets the user data key. /// diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index 3d1051b18..4c0d1fdfb 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -36,6 +36,7 @@ namespace MediaBrowser.Controller.Entities.TV SoundtrackIds = new List(); RemoteTrailers = new List(); LocalTrailerIds = new List(); + RemoteTrailerIds = new List(); DisplaySpecialsWithSeasons = true; } @@ -57,7 +58,8 @@ namespace MediaBrowser.Controller.Entities.TV public bool DisplaySpecialsWithSeasons { get; set; } public List LocalTrailerIds { get; set; } - + public List RemoteTrailerIds { get; set; } + public List RemoteTrailers { get; set; } /// @@ -109,6 +111,17 @@ namespace MediaBrowser.Controller.Entities.TV return this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Tvcom) ?? base.GetUserDataKey(); } + /// + /// Gets the trailer ids. + /// + /// List<Guid>. + public List GetTrailerIds() + { + var list = LocalTrailerIds.ToList(); + list.AddRange(RemoteTrailerIds); + return list; + } + // Studio, Genre and Rating will all be the same so makes no sense to index by these protected override IEnumerable GetIndexByOptions() { diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs index 07173d26f..bb165d790 100644 --- a/MediaBrowser.Controller/Entities/Trailer.cs +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -13,7 +13,7 @@ namespace MediaBrowser.Controller.Entities /// Class Trailer /// [Obsolete] - public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasProductionLocations, IHasBudget, IHasTrailers, IHasKeywords, IHasTaglines, IHasMetascore, IHasLookupInfo + public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasProductionLocations, IHasBudget, IHasKeywords, IHasTaglines, IHasMetascore, IHasLookupInfo { public List SoundtrackIds { get; set; } @@ -24,15 +24,12 @@ namespace MediaBrowser.Controller.Entities RemoteTrailers = new List(); Taglines = new List(); SoundtrackIds = new List(); - LocalTrailerIds = new List(); Keywords = new List(); ProductionLocations = new List(); } public float? Metascore { get; set; } - public List LocalTrailerIds { get; set; } - public List RemoteTrailers { get; set; } public List Keywords { get; set; } diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index aff4af468..166d56c51 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -1428,7 +1428,7 @@ namespace MediaBrowser.Controller.Entities var hasTrailers = item as IHasTrailers; if (hasTrailers != null) { - trailerCount = hasTrailers.LocalTrailerIds.Count; + trailerCount = hasTrailers.GetTrailerIds().Count; } var ok = val ? trailerCount > 0 : trailerCount == 0; diff --git a/MediaBrowser.Controller/Sync/ISyncManager.cs b/MediaBrowser.Controller/Sync/ISyncManager.cs index 1e744a087..1d5ab7d3e 100644 --- a/MediaBrowser.Controller/Sync/ISyncManager.cs +++ b/MediaBrowser.Controller/Sync/ISyncManager.cs @@ -1,6 +1,4 @@ -using System.IO; -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Devices; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Querying; using MediaBrowser.Model.Sync; using System.Collections.Generic; diff --git a/MediaBrowser.Controller/Sync/ISyncRepository.cs b/MediaBrowser.Controller/Sync/ISyncRepository.cs index 9cce69bdc..d0cf87182 100644 --- a/MediaBrowser.Controller/Sync/ISyncRepository.cs +++ b/MediaBrowser.Controller/Sync/ISyncRepository.cs @@ -1,5 +1,6 @@ using MediaBrowser.Model.Querying; using MediaBrowser.Model.Sync; +using System.Collections.Generic; using System.Threading.Tasks; namespace MediaBrowser.Controller.Sync @@ -27,6 +28,13 @@ namespace MediaBrowser.Controller.Sync /// Task. Task Update(SyncJob job); + /// + /// Deletes the job. + /// + /// The identifier. + /// Task. + Task DeleteJob(string id); + /// /// Gets the jobs. /// @@ -54,5 +62,12 @@ namespace MediaBrowser.Controller.Sync /// The job item. /// Task. Task Update(SyncJobItem jobItem); + + /// + /// Gets the job items. + /// + /// The job identifier. + /// IEnumerable<SyncJobItem>. + IEnumerable GetJobItems(string jobId); } } -- cgit v1.2.3