Simplify metadata subdir check

This commit is contained in:
Shadowghost 2024-06-08 21:57:21 +02:00
parent 302eea1cb7
commit fd009fc71b

View File

@ -42,10 +42,10 @@ namespace MediaBrowser.LocalMetadata.Images
var images = GetImageFilesFromFolder(nameWithoutExtension, parentPathFiles);
var metadataSubPath = directoryService.GetDirectories(parentPath).Where(d => d.Name.EndsWith("metadata", StringComparison.OrdinalIgnoreCase)).ToList();
foreach (var path in metadataSubPath)
var metadataSubDir = directoryService.GetDirectories(parentPath).FirstOrDefault(d => d.Name.Equals("metadata", StringComparison.Ordinal));
if (metadataSubDir is not null)
{
var files = directoryService.GetFiles(path.FullName);
var files = directoryService.GetFiles(metadataSubDir.FullName);
images.AddRange(GetImageFilesFromFolder(nameWithoutExtension, files));
}