Sort external files when scanning

Sorts files such as external subtitles or audio as well as metadata
Useful for deterministic display in the UI.
This commit is contained in:
Jendrik Weise 2022-11-04 15:16:27 +01:00
parent c306428f2c
commit 21072310e7

View File

@ -175,12 +175,12 @@ namespace MediaBrowser.Providers.MediaInfo
return Array.Empty<ExternalPathParserResult>();
}
var files = directoryService.GetFilePaths(folder, clearCache).ToList();
var files = directoryService.GetFilePaths(folder, clearCache, true).ToList();
files.Remove(video.Path);
var internalMetadataPath = video.GetInternalMetadataPath();
if (_fileSystem.DirectoryExists(internalMetadataPath))
{
files.AddRange(directoryService.GetFilePaths(internalMetadataPath, clearCache));
files.AddRange(directoryService.GetFilePaths(internalMetadataPath, clearCache, true));
}
if (!files.Any())