diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-07-05 02:01:31 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-07-05 02:01:31 -0400 |
| commit | 1fcbd3c6da5bd061473a3f34a6410c9bbce0fc13 (patch) | |
| tree | 2d27570ad71afa59d0f89bdfaeafa0ca06512929 /MediaBrowser.Server.Implementations/Library | |
| parent | 2772d595596b3e682dbce890e53bdc3ef027df46 (diff) | |
denormalize seriesid
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs index e279a978e..6d0f4ffe2 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs @@ -30,23 +30,32 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV return null; } - var season = parent as Season; - - // Just in case the user decided to nest episodes. - // Not officially supported but in some cases we can handle it. - if (season == null) - { - season = parent.GetParents().OfType<Season>().FirstOrDefault(); - } - // If the parent is a Season or Series, then this is an Episode if the VideoResolver returns something // Also handle flat tv folders - if (season != null || args.HasParent<Series>() || string.Equals(args.GetCollectionType(), CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)) + if (string.Equals(args.GetCollectionType(), CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)) { var episode = ResolveVideo<Episode>(args, false); if (episode != null) { + var season = parent as Season; + // Just in case the user decided to nest episodes. + // Not officially supported but in some cases we can handle it. + if (season == null) + { + season = parent.GetParents().OfType<Season>().FirstOrDefault(); + } + + var series = parent as Series; + if (series == null) + { + series = parent.GetParents().OfType<Series>().FirstOrDefault(); + } + + if (series != null) + { + episode.SeriesId = series.Id; + } if (season != null) { episode.SeasonId = season.Id; |
