diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2025-08-03 17:29:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-03 17:29:04 -0400 |
| commit | 0f5bb5cf767e8c5a767be32e26016cae17ae341c (patch) | |
| tree | eec847f0f735ecff7a4301a79e8e34023ccfe8b8 /Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs | |
| parent | ce78af2ed4f203690a0f9ef87b08b27a6bd43f63 (diff) | |
| parent | 7785b51f572cf48a62dfc2ee60fc1db0ccedf1a2 (diff) | |
Merge pull request #14540 from TokerX/issue-8641
Improve extra rule resolution and file handling
Diffstat (limited to 'Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index f29a0b3ad..f9538fbad 100644 --- a/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -38,7 +38,8 @@ namespace Emby.Server.Implementations.Library } // Don't ignore top level folders - if (fileInfo.IsDirectory && parent is AggregateFolder) + if (fileInfo.IsDirectory + && (parent is AggregateFolder || (parent?.IsTopParent ?? false))) { return false; } @@ -48,35 +49,21 @@ namespace Emby.Server.Implementations.Library return true; } - var filename = fileInfo.Name; - - if (fileInfo.IsDirectory) + if (parent is null) { - if (parent is not null) - { - // Ignore extras for unsupported types - if (_namingOptions.AllExtrasTypesFolderNames.ContainsKey(filename) - && parent is not AggregateFolder - && parent is not UserRootFolder) - { - return true; - } - } + return false; } - else + + if (fileInfo.IsDirectory) { - if (parent is not null) - { - // Don't resolve theme songs - if (Path.GetFileNameWithoutExtension(filename.AsSpan()).Equals(BaseItem.ThemeSongFileName, StringComparison.Ordinal) - && AudioFileParser.IsAudioFile(filename, _namingOptions)) - { - return true; - } - } + // Ignore extras for unsupported types + return _namingOptions.AllExtrasTypesFolderNames.ContainsKey(fileInfo.Name) + && parent is not UserRootFolder; } - return false; + // Don't resolve theme songs + return Path.GetFileNameWithoutExtension(fileInfo.Name.AsSpan()).Equals(BaseItem.ThemeSongFileName, StringComparison.Ordinal) + && AudioFileParser.IsAudioFile(fileInfo.Name, _namingOptions); } } } |
