diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-12-22 18:54:45 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-22 18:54:45 -0500 |
| commit | 026e58eb16b839c31cd8fb16829265c2f9087a5d (patch) | |
| tree | 656be3f3a30a5a532b1a17a0ad3b27fb91473b7b /Emby.Server.Implementations/Library | |
| parent | ef671725559ef394337343af510ecb557b700d17 (diff) | |
| parent | 02f749c654a5af4525304ed3ee470ba40c6405b9 (diff) | |
Merge pull request #2364 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Library')
| -rw-r--r-- | Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 55a63b4e5..b791311f9 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -74,21 +74,21 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase)) { - return ResolveVideos<MusicVideo>(parent, files, directoryService, false); + return ResolveVideos<MusicVideo>(parent, files, directoryService, false, collectionType); } if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase) || string.Equals(collectionType, CollectionType.Photos, StringComparison.OrdinalIgnoreCase)) { - return ResolveVideos<Video>(parent, files, directoryService, false); + return ResolveVideos<Video>(parent, files, directoryService, false, collectionType); } - if (string.IsNullOrEmpty(collectionType)) + if (string.IsNullOrWhiteSpace(collectionType)) { // Owned items should just use the plain video type if (parent == null) { - return ResolveVideos<Video>(parent, files, directoryService, false); + return ResolveVideos<Video>(parent, files, directoryService, false, collectionType); } if (parent is Series || parent.GetParents().OfType<Series>().Any()) @@ -96,18 +96,18 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies return null; } - return ResolveVideos<Movie>(parent, files, directoryService, false); + return ResolveVideos<Movie>(parent, files, directoryService, false, collectionType); } if (string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase)) { - return ResolveVideos<Movie>(parent, files, directoryService, true); + return ResolveVideos<Movie>(parent, files, directoryService, true, collectionType); } return null; } - private MultiItemResolverResult ResolveVideos<T>(Folder parent, IEnumerable<FileSystemMetadata> fileSystemEntries, IDirectoryService directoryService, bool suppportMultiEditions) + private MultiItemResolverResult ResolveVideos<T>(Folder parent, IEnumerable<FileSystemMetadata> fileSystemEntries, IDirectoryService directoryService, bool suppportMultiEditions, string collectionType) where T : Video, new() { var files = new List<FileSystemMetadata>(); @@ -117,6 +117,16 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies // Loop through each child file/folder and see if we find a video foreach (var child in fileSystemEntries) { + // This is a hack but currently no better way to resolve a sometimes ambiguous situation + if (string.IsNullOrWhiteSpace(collectionType)) + { + if (string.Equals(child.Name, "tvshow.nfo", StringComparison.OrdinalIgnoreCase) || + string.Equals(child.Name, "season.nfo", StringComparison.OrdinalIgnoreCase)) + { + return null; + } + } + if (child.IsDirectory) { leftOver.Add(child); @@ -408,7 +418,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies !string.Equals(collectionType, CollectionType.Photos) && !string.Equals(collectionType, CollectionType.MusicVideos); - var result = ResolveVideos<T>(parent, fileSystemEntries, directoryService, supportsMultiVersion); + var result = ResolveVideos<T>(parent, fileSystemEntries, directoryService, supportsMultiVersion, collectionType) ?? + new MultiItemResolverResult(); if (result.Items.Count == 1) { |
