From 329e04780375741d44aba3058a4e35b985903db6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 20 May 2016 17:32:43 -0400 Subject: update seasons --- MediaBrowser.Controller/Entities/TV/Season.cs | 29 +++++++++++----------- MediaBrowser.Controller/Entities/TV/Series.cs | 2 +- .../Entities/UserViewBuilder.cs | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index 10436e0f24..53989943b5 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -134,7 +134,7 @@ namespace MediaBrowser.Controller.Entities.TV if (!result) { - if (!IsMissingSeason.HasValue) + if (!IsVirtualItem.HasValue) { return true; } @@ -144,12 +144,18 @@ namespace MediaBrowser.Controller.Entities.TV } [IgnoreDataMember] - public bool? IsMissingSeason { get; set; } + public bool? IsVirtualItem { get; set; } + + [IgnoreDataMember] + public bool IsMissingSeason + { + get { return (IsVirtualItem ?? false) && !IsUnaired; } + } [IgnoreDataMember] public bool IsVirtualUnaired { - get { return LocationType == LocationType.Virtual && IsUnaired; } + get { return (IsVirtualItem ?? false) && IsUnaired; } } [IgnoreDataMember] @@ -313,19 +319,14 @@ namespace MediaBrowser.Controller.Entities.TV { var hasChanges = base.BeforeMetadataRefresh(); - var locationType = LocationType; - - if (locationType == LocationType.FileSystem || locationType == LocationType.Offline) + if (!IndexNumber.HasValue && !string.IsNullOrEmpty(Path)) { - if (!IndexNumber.HasValue && !string.IsNullOrEmpty(Path)) - { - IndexNumber = IndexNumber ?? LibraryManager.GetSeasonNumberFromPath(Path); + IndexNumber = IndexNumber ?? LibraryManager.GetSeasonNumberFromPath(Path); - // If a change was made record it - if (IndexNumber.HasValue) - { - hasChanges = true; - } + // If a change was made record it + if (IndexNumber.HasValue) + { + hasChanges = true; } } diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index a1e7c7e15e..17fc0c0d29 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -240,7 +240,7 @@ namespace MediaBrowser.Controller.Entities.TV if (!includeMissingSeasons) { - seasons = seasons.Where(i => !(i.IsMissingSeason ?? false)); + seasons = seasons.Where(i => !(i.IsMissingSeason)); } if (!includeVirtualUnaired) { diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index fbca357cd8..d4a8b07305 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -1142,7 +1142,7 @@ namespace MediaBrowser.Controller.Entities var e = i as Season; if (e != null) { - return (e.IsMissingSeason ?? false) == val; + return (e.IsMissingSeason) == val; } return true; }); -- cgit v1.2.3