mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-28 02:21:00 +01:00
Fix use of thread-unsafe List<T>.Sort()
This commit is contained in:
@@ -105,7 +105,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
public IReadOnlyList<string> GetFilePaths(string path)
|
||||
=> GetFilePaths(path, false);
|
||||
|
||||
public IReadOnlyList<string> GetFilePaths(string path, bool clearCache, bool sort = false)
|
||||
public IReadOnlyList<string> GetFilePaths(string path, bool clearCache)
|
||||
{
|
||||
if (clearCache)
|
||||
{
|
||||
@@ -118,7 +118,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
try
|
||||
{
|
||||
return fileSystem.GetFilePaths(p).ToList();
|
||||
return fileSystem.GetFilePaths(p).OrderBy(x => x).ToList();
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
@@ -127,11 +127,6 @@ namespace MediaBrowser.Controller.Providers
|
||||
},
|
||||
_fileSystem);
|
||||
|
||||
if (sort)
|
||||
{
|
||||
filePaths.Sort();
|
||||
}
|
||||
|
||||
return filePaths;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
IReadOnlyList<string> GetFilePaths(string path);
|
||||
|
||||
IReadOnlyList<string> GetFilePaths(string path, bool clearCache, bool sort = false);
|
||||
IReadOnlyList<string> GetFilePaths(string path, bool clearCache);
|
||||
|
||||
bool IsAccessible(string path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user