mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-13 08:37:07 +00:00
Fix use of thread-unsafe List<T>.Sort()
This commit is contained in:
parent
ec04313317
commit
6f2e42c20c
4 changed files with 16 additions and 21 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue