aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/TV
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-15 23:26:39 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-15 23:26:39 -0400
commit6ca771cc7906ae6524f737ae9bf0bc1b916efb40 (patch)
tree98d4c8fad6868d0836caec61446f2cffc4a232f8 /MediaBrowser.Controller/Entities/TV
parentb889c31f5629b0d46fdd8f71d62f1546e18efc11 (diff)
move user image into profile settings
Diffstat (limited to 'MediaBrowser.Controller/Entities/TV')
-rw-r--r--MediaBrowser.Controller/Entities/TV/Episode.cs41
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;
}
}