diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-22 12:05:06 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-22 12:05:06 -0500 |
| commit | 9d40b684bf6af4e987e226c78c11d6daf6f5cd9b (patch) | |
| tree | 937312aa29772d0e042929798e936710fbc7c74c /MediaBrowser.Server.Implementations/Library/Resolvers | |
| parent | cf1dac60f632646fa6ccdc715eee9fa5cf240bf3 (diff) | |
#680 - episode organization
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Resolvers')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs index 420c9f583..d8af92991 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs @@ -19,20 +19,23 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV protected override Episode Resolve(ItemResolveArgs args) { var parent = args.Parent; + + if (parent == null) + { + 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) { - if (parent != null) - { - season = parent.Parents.OfType<Season>().FirstOrDefault(); - } + season = parent.Parents.OfType<Season>().FirstOrDefault(); } // If the parent is a Season or Series, then this is an Episode if the VideoResolver returns something - if (season != null || args.Parent is Series) + if (season != null || parent.Parents.OfType<Series>().Any()) { Episode episode = null; |
