diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-15 23:26:39 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-15 23:26:39 -0400 |
| commit | 6ca771cc7906ae6524f737ae9bf0bc1b916efb40 (patch) | |
| tree | 98d4c8fad6868d0836caec61446f2cffc4a232f8 /MediaBrowser.Controller/Entities/TV | |
| parent | b889c31f5629b0d46fdd8f71d62f1546e18efc11 (diff) | |
move user image into profile settings
Diffstat (limited to 'MediaBrowser.Controller/Entities/TV')
| -rw-r--r-- | MediaBrowser.Controller/Entities/TV/Episode.cs | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index b95c7df9c5..87074ca022 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -146,7 +146,27 @@ namespace MediaBrowser.Controller.Entities.TV [IgnoreDataMember] public Season Season { - get { return FindParent<Season>(); } + get + { + var season = FindParent<Season>(); + + // Episodes directly in series folder + if (season == null) + { + var series = FindParent<Series>(); + + if (ParentIndexNumber.HasValue) + { + var findNumber = ParentIndexNumber.Value; + + season = series.Children + .OfType<Season>() + .FirstOrDefault(i => i.IndexNumber.HasValue && i.IndexNumber.Value == findNumber); + } + } + + return season; + } } [IgnoreDataMember] @@ -237,25 +257,6 @@ namespace MediaBrowser.Controller.Entities.TV return season.Id; } - var seasonNumber = ParentIndexNumber; - - // Parent is a Series - if (seasonNumber.HasValue) - { - var series = Series; - - if (series != null) - { - season = series.Children.OfType<Season>() - .FirstOrDefault(i => i.IndexNumber.HasValue && i.IndexNumber.Value == seasonNumber.Value); - - if (season != null) - { - return season.Id; - } - } - } - return null; } } |
