diff options
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/TV/Episode.cs | 16 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/TV/Season.cs | 18 |
2 files changed, 32 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 14c6554556..e15a7d4d02 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; @@ -191,5 +192,18 @@ namespace MediaBrowser.Controller.Entities.TV return false; } + + public bool IsMissingEpisode + { + get + { + return LocationType == Model.Entities.LocationType.Virtual && PremiereDate.HasValue && PremiereDate.Value < DateTime.UtcNow; + } + } + + public bool IsUnaired + { + get { return LocationType == Model.Entities.LocationType.Virtual && PremiereDate.HasValue && PremiereDate.Value >= DateTime.UtcNow; } + } } } diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index 9f15de920a..9a0959cad6 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.Library; +using System.Linq; +using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Localization; using System; using System.Collections.Generic; @@ -147,5 +148,20 @@ namespace MediaBrowser.Controller.Entities.TV { return IndexNumber != null ? IndexNumber.Value.ToString("0000") : Name; } + + public bool IsMissingSeason + { + get { return LocationType == Model.Entities.LocationType.Virtual && Children.OfType<Episode>().All(i => i.IsMissingEpisode); } + } + + public bool IsUnaired + { + get { return LocationType == Model.Entities.LocationType.Virtual && Children.OfType<Episode>().All(i => i.IsUnaired); } + } + + public bool IsMissingOrUnaired + { + get { return LocationType == Model.Entities.LocationType.Virtual && Children.OfType<Episode>().All(i => i.IsUnaired || i.IsMissingEpisode); } + } } } |
