diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-10-26 18:01:21 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-10-26 18:01:21 -0400 |
| commit | 976523afa92420de1b690e3a7e35e003e1899ff9 (patch) | |
| tree | 7605e74a5b58369c3f067bc47d2586f1958cca1c /MediaBrowser.Controller | |
| parent | a4a3800de56f8cb8185e95a9c343b74db0bbdcea (diff) | |
added new params for missing/unaired
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); } + } } } |
