diff options
| author | stefan <stefan@hegedues.at> | 2018-09-12 19:26:21 +0200 |
|---|---|---|
| committer | stefan <stefan@hegedues.at> | 2018-09-12 19:26:21 +0200 |
| commit | 48facb797ed912e4ea6b04b17d1ff190ac2daac4 (patch) | |
| tree | 8dae77a31670a888d733484cb17dd4077d5444e8 /Emby.Server.Implementations/Library/Resolvers/Audio | |
| parent | c32d8656382a0eacb301692e0084377fc433ae9b (diff) | |
Update to 3.5.2 and .net core 2.1
Diffstat (limited to 'Emby.Server.Implementations/Library/Resolvers/Audio')
| -rw-r--r-- | Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs | 8 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs | 33 |
2 files changed, 21 insertions, 20 deletions
diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs index d30aaa133..8872bd641 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs @@ -101,13 +101,15 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio if (LibraryManager.IsAudioFile(args.Path, libraryOptions)) { - if (string.Equals(Path.GetExtension(args.Path), ".cue", StringComparison.OrdinalIgnoreCase)) + var extension = Path.GetExtension(args.Path); + + if (string.Equals(extension, ".cue", StringComparison.OrdinalIgnoreCase)) { // if audio file exists of same name, return null return null; } - var isMixedCollectionType = string.IsNullOrWhiteSpace(collectionType); + var isMixedCollectionType = string.IsNullOrEmpty(collectionType); // For conflicting extensions, give priority to videos if (isMixedCollectionType && LibraryManager.IsVideoFile(args.Path, libraryOptions)) @@ -134,6 +136,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio if (item != null) { + item.IsShortcut = string.Equals(extension, ".strm", StringComparison.OrdinalIgnoreCase); + item.IsInMixedFolder = true; } diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs index b8ec41805..a33f101ae 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs @@ -52,14 +52,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio /// <returns>MusicAlbum.</returns> protected override MusicAlbum Resolve(ItemResolveArgs args) { - if (!args.IsDirectory) return null; - - // Avoid mis-identifying top folders - if (args.HasParent<MusicAlbum>()) return null; - if (args.Parent.IsRoot) return null; - var collectionType = args.GetCollectionType(); - var isMusicMediaFolder = string.Equals(collectionType, CollectionType.Music, StringComparison.OrdinalIgnoreCase); // If there's a collection type and it's not music, don't allow it. @@ -68,6 +61,12 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio return null; } + if (!args.IsDirectory) return null; + + // Avoid mis-identifying top folders + if (args.HasParent<MusicAlbum>()) return null; + if (args.Parent.IsRoot) return null; + return IsMusicAlbum(args) ? new MusicAlbum() : null; } @@ -117,24 +116,22 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio { if (allowSubfolders) { + if (notMultiDisc) + { + continue; + } + var path = fileSystemInfo.FullName; - var isMultiDisc = IsMultiDiscFolder(path, libraryOptions); + var hasMusic = ContainsMusic(directoryService.GetFileSystemEntries(path), false, directoryService, logger, fileSystem, libraryOptions, libraryManager); - if (isMultiDisc) + if (hasMusic) { - var hasMusic = ContainsMusic(directoryService.GetFileSystemEntries(path), false, directoryService, logger, fileSystem, libraryOptions, libraryManager); - - if (hasMusic) + if (IsMultiDiscFolder(path, libraryOptions)) { logger.Debug("Found multi-disc folder: " + path); discSubfolderCount++; } - } - else - { - var hasMusic = ContainsMusic(directoryService.GetFileSystemEntries(path), false, directoryService, logger, fileSystem, libraryOptions, libraryManager); - - if (hasMusic) + else { // If there are folders underneath with music that are not multidisc, then this can't be a multi-disc album notMultiDisc = true; |
