diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-07-27 14:24:48 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-07-27 14:24:48 -0400 |
| commit | 898d55d8663d4426ee03a3f72b2f566585e489c8 (patch) | |
| tree | 5b11a6706951ada619ecd773c426d8e90d6cf795 /MediaBrowser.Server.Implementations/Library/Resolvers/TV | |
| parent | a4142e87647cadda1b3a157935e500ade683cc38 (diff) | |
factor collection type in resolving process
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Resolvers/TV')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs index 10e73b288..9c8f4dceb 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs @@ -13,6 +13,13 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV /// </summary> public class SeriesResolver : FolderResolver<Series> { + private readonly ILibraryManager _libraryManager; + + public SeriesResolver(ILibraryManager libraryManager) + { + _libraryManager = libraryManager; + } + /// <summary> /// Gets the priority. /// </summary> @@ -46,6 +53,15 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV return null; } + var collectionType = args.Parent == null ? null : _libraryManager.FindCollectionType(args.Parent); + + // If there's a collection type and it's not tv, it can't be a series + if (!string.IsNullOrEmpty(collectionType) && + !string.Equals(collectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)) + { + return null; + } + // It's a Series if any of the following conditions are met: // series.xml exists // [tvdbid= is present in the path |
