From 50ea8cd941a6da3f2b2870c8add08f64dc8055d9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 10 Dec 2013 16:26:30 -0500 Subject: [PATCH] added series level settings to control display of specials --- MediaBrowser.Api/ItemUpdateService.cs | 5 +++++ MediaBrowser.Controller/Entities/TV/Series.cs | 5 ++++- MediaBrowser.Model/Dto/BaseItemDto.cs | 1 + MediaBrowser.Model/Querying/ItemFields.cs | 2 +- MediaBrowser.Server.Implementations/Dto/DtoService.cs | 7 ++++++- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index 3e79fb91c..17a87a861 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -385,6 +385,11 @@ namespace MediaBrowser.Api series.Status = request.Status; series.AirDays = request.AirDays; series.AirTime = request.AirTime; + + if (request.DisplaySpecialsWithSeasons.HasValue) + { + series.DisplaySpecialsWithSeasons = request.DisplaySpecialsWithSeasons.Value; + } } } diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index 1c4bef942..b8adc6581 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -29,8 +29,11 @@ namespace MediaBrowser.Controller.Entities.TV RemoteTrailers = new List(); LocalTrailerIds = new List(); Tags = new List(); + DisplaySpecialsWithSeasons = true; } + public bool DisplaySpecialsWithSeasons { get; set; } + public List LocalTrailerIds { get; set; } public List RemoteTrailers { get; set; } @@ -157,7 +160,7 @@ namespace MediaBrowser.Controller.Entities.TV var episodes = GetRecursiveChildren(user) .OfType(); - episodes = FilterEpisodesBySeason(episodes, seasonNumber, true); + episodes = FilterEpisodesBySeason(episodes, seasonNumber, DisplaySpecialsWithSeasons); var config = user.Configuration; diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 7b067dd1f..0690de5ce 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -34,6 +34,7 @@ namespace MediaBrowser.Model.Dto public int? AirsAfterSeasonNumber { get; set; } public int? AirsBeforeEpisodeNumber { get; set; } public int? AbsoluteEpisodeNumber { get; set; } + public bool? DisplaySpecialsWithSeasons { get; set; } /// /// Gets or sets the DVD season number. diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.cs index 71c3d59cd..6d61d8ac7 100644 --- a/MediaBrowser.Model/Querying/ItemFields.cs +++ b/MediaBrowser.Model/Querying/ItemFields.cs @@ -59,7 +59,7 @@ namespace MediaBrowser.Model.Querying /// /// The metadata settings /// - MetadataSettings, + Settings, /// /// The original run time ticks diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 936239657..faa9b0e61 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -728,7 +728,7 @@ namespace MediaBrowser.Server.Implementations.Dto dto.DisplayMediaType = item.DisplayMediaType; - if (fields.Contains(ItemFields.MetadataSettings)) + if (fields.Contains(ItemFields.Settings)) { dto.LockedFields = item.LockedFields; dto.EnableInternetProviders = !item.DontFetchMeta; @@ -1093,6 +1093,11 @@ namespace MediaBrowser.Server.Implementations.Dto dto.SpecialFeatureCount = series.SpecialFeatureIds.Count; dto.SeasonCount = series.SeasonCount; + + if (fields.Contains(ItemFields.Settings)) + { + dto.DisplaySpecialsWithSeasons = series.DisplaySpecialsWithSeasons; + } } if (episode != null)