diff options
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Game.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/IHasTrailers.cs | 9 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Movies/BoxSet.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Movies/Movie.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/TV/Series.cs | 15 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Trailer.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/UserViewBuilder.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Sync/ISyncManager.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Sync/ISyncRepository.cs | 15 |
9 files changed, 79 insertions, 10 deletions
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<Guid>(); RemoteTrailers = new List<MediaUrl>(); LocalTrailerIds = new List<Guid>(); + RemoteTrailerIds = new List<Guid>(); ThemeSongIds = new List<Guid>(); ThemeVideoIds = new List<Guid>(); Tags = new List<string>(); } public List<Guid> LocalTrailerIds { get; set; } + public List<Guid> RemoteTrailerIds { get; set; } /// <summary> /// Gets or sets the tags. @@ -119,5 +121,16 @@ namespace MediaBrowser.Controller.Entities return id; } + + /// <summary> + /// Gets the trailer ids. + /// </summary> + /// <returns>List<Guid>.</returns> + public List<Guid> 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 { /// <summary> /// Gets or sets the remote trailers. @@ -17,5 +17,12 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <value>The local trailer ids.</value> List<Guid> LocalTrailerIds { get; set; } + List<Guid> RemoteTrailerIds { get; set; } + + /// <summary> + /// Gets the trailer ids. + /// </summary> + /// <returns>List<Guid>.</returns> + List<Guid> 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<MediaUrl>(); LocalTrailerIds = new List<Guid>(); + RemoteTrailerIds = new List<Guid>(); DisplayOrder = ItemSortBy.PremiereDate; Keywords = new List<string>(); @@ -35,6 +36,7 @@ namespace MediaBrowser.Controller.Entities.Movies } public List<Guid> LocalTrailerIds { get; set; } + public List<Guid> RemoteTrailerIds { get; set; } /// <summary> /// Gets or sets the remote trailers. @@ -76,6 +78,17 @@ namespace MediaBrowser.Controller.Entities.Movies } } + /// <summary> + /// Gets the trailer ids. + /// </summary> + /// <returns>List<Guid>.</returns> + public List<Guid> GetTrailerIds() + { + var list = LocalTrailerIds.ToList(); + list.AddRange(RemoteTrailerIds); + return list; + } + public override IEnumerable<BaseItem> 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<Guid>(); RemoteTrailers = new List<MediaUrl>(); LocalTrailerIds = new List<Guid>(); + RemoteTrailerIds = new List<Guid>(); ThemeSongIds = new List<Guid>(); ThemeVideoIds = new List<Guid>(); BoxSetIdList = new List<Guid>(); @@ -49,6 +50,7 @@ namespace MediaBrowser.Controller.Entities.Movies public float? Metascore { get; set; } public List<Guid> LocalTrailerIds { get; set; } + public List<Guid> RemoteTrailerIds { get; set; } public List<string> Keywords { get; set; } public List<MediaUrl> RemoteTrailers { get; set; } @@ -90,6 +92,17 @@ namespace MediaBrowser.Controller.Entities.Movies public string TmdbCollectionName { get; set; } /// <summary> + /// Gets the trailer ids. + /// </summary> + /// <returns>List<Guid>.</returns> + public List<Guid> GetTrailerIds() + { + var list = LocalTrailerIds.ToList(); + list.AddRange(RemoteTrailerIds); + return list; + } + + /// <summary> /// Gets the user data key. /// </summary> /// <returns>System.String.</returns> 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<Guid>(); RemoteTrailers = new List<MediaUrl>(); LocalTrailerIds = new List<Guid>(); + RemoteTrailerIds = new List<Guid>(); DisplaySpecialsWithSeasons = true; } @@ -57,7 +58,8 @@ namespace MediaBrowser.Controller.Entities.TV public bool DisplaySpecialsWithSeasons { get; set; } public List<Guid> LocalTrailerIds { get; set; } - + public List<Guid> RemoteTrailerIds { get; set; } + public List<MediaUrl> RemoteTrailers { get; set; } /// <summary> @@ -109,6 +111,17 @@ namespace MediaBrowser.Controller.Entities.TV return this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Tvcom) ?? base.GetUserDataKey(); } + /// <summary> + /// Gets the trailer ids. + /// </summary> + /// <returns>List<Guid>.</returns> + public List<Guid> 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<string> 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 /// </summary> [Obsolete] - public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasProductionLocations, IHasBudget, IHasTrailers, IHasKeywords, IHasTaglines, IHasMetascore, IHasLookupInfo<TrailerInfo> + public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasProductionLocations, IHasBudget, IHasKeywords, IHasTaglines, IHasMetascore, IHasLookupInfo<TrailerInfo> { public List<Guid> SoundtrackIds { get; set; } @@ -24,15 +24,12 @@ namespace MediaBrowser.Controller.Entities RemoteTrailers = new List<MediaUrl>(); Taglines = new List<string>(); SoundtrackIds = new List<Guid>(); - LocalTrailerIds = new List<Guid>(); Keywords = new List<string>(); ProductionLocations = new List<string>(); } public float? Metascore { get; set; } - public List<Guid> LocalTrailerIds { get; set; } - public List<MediaUrl> RemoteTrailers { get; set; } public List<string> 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 @@ -28,6 +29,13 @@ namespace MediaBrowser.Controller.Sync Task Update(SyncJob job); /// <summary> + /// Deletes the job. + /// </summary> + /// <param name="id">The identifier.</param> + /// <returns>Task.</returns> + Task DeleteJob(string id); + + /// <summary> /// Gets the jobs. /// </summary> /// <param name="query">The query.</param> @@ -54,5 +62,12 @@ namespace MediaBrowser.Controller.Sync /// <param name="jobItem">The job item.</param> /// <returns>Task.</returns> Task Update(SyncJobItem jobItem); + + /// <summary> + /// Gets the job items. + /// </summary> + /// <param name="jobId">The job identifier.</param> + /// <returns>IEnumerable<SyncJobItem>.</returns> + IEnumerable<SyncJobItem> GetJobItems(string jobId); } } |
