diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-04-07 15:26:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-07 15:26:59 -0400 |
| commit | 7c55cd08cbfc1c4a6ba2823007432316e1efce8d (patch) | |
| tree | b045a71d84deeb89a85975d34a7a2ded2642c0d5 /Emby.Server.Implementations/Library/Resolvers | |
| parent | 66e901ef93942c631c3ee3b222cc75265e1b17fb (diff) | |
| parent | 6f7d8bb742f3594bdca16fa5c20c55707edad158 (diff) | |
Merge pull request #2567 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations/Library/Resolvers')
| -rw-r--r-- | Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs | 2 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs | 15 |
2 files changed, 8 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs index 384ed8dac..9a5d6b105 100644 --- a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs @@ -276,7 +276,7 @@ namespace Emby.Server.Implementations.Library.Resolvers return false; } - return directoryService.GetFiles(fullPath).Any(i => string.Equals(i.Extension, ".vob", StringComparison.OrdinalIgnoreCase)); + return directoryService.GetFilePaths(fullPath).Any(i => string.Equals(Path.GetExtension(i), ".vob", StringComparison.OrdinalIgnoreCase)); } /// <summary> diff --git a/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs index df39e57ad..0968e8ea2 100644 --- a/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs @@ -5,10 +5,6 @@ using MediaBrowser.Model.Entities; using System; using System.IO; using System.Linq; -using MediaBrowser.Common.IO; -using MediaBrowser.Model.IO; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.IO; using MediaBrowser.Model.Configuration; namespace Emby.Server.Implementations.Library.Resolvers @@ -45,7 +41,7 @@ namespace Emby.Server.Implementations.Library.Resolvers var filename = Path.GetFileNameWithoutExtension(args.Path); // Make sure the image doesn't belong to a video file - if (args.DirectoryService.GetFiles(Path.GetDirectoryName(args.Path)).Any(i => IsOwnedByMedia(args.GetLibraryOptions(), i, filename))) + if (args.DirectoryService.GetFilePaths(Path.GetDirectoryName(args.Path)).Any(i => IsOwnedByMedia(args.GetLibraryOptions(), i, filename))) { return null; } @@ -61,11 +57,14 @@ namespace Emby.Server.Implementations.Library.Resolvers return null; } - private bool IsOwnedByMedia(LibraryOptions libraryOptions, FileSystemMetadata file, string imageFilename) + private bool IsOwnedByMedia(LibraryOptions libraryOptions, string file, string imageFilename) { - if (_libraryManager.IsVideoFile(file.FullName, libraryOptions) && imageFilename.StartsWith(Path.GetFileNameWithoutExtension(file.Name), StringComparison.OrdinalIgnoreCase)) + if (_libraryManager.IsVideoFile(file, libraryOptions)) { - return true; + if (imageFilename.StartsWith(Path.GetFileNameWithoutExtension(file), StringComparison.OrdinalIgnoreCase)) + { + return true; + } } return false; |
