diff options
| author | Niels van Velzen <nielsvanvelzen@users.noreply.github.com> | 2026-05-05 15:48:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-05 15:48:46 +0200 |
| commit | b227f3e85b62b63030a310d8dfb7ea2fdf052222 (patch) | |
| tree | ec0f8be47cecfb126a531f55863f82883190a12a /MediaBrowser.Controller | |
| parent | fd6badf096cd1e18e7089cf3807f6e73bf49fe4e (diff) | |
| parent | 6f2e42c20c43fdafe66e4403979c5b3e50a90360 (diff) | |
Merge pull request #16777 from gabeluci/fix-directoryservice-sort
Fix use of thread-unsafe List<T>.Sort()
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Providers/DirectoryService.cs | 9 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Providers/IDirectoryService.cs | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs index 5b5af75a47..6060d051a5 100644 --- a/MediaBrowser.Controller/Providers/DirectoryService.cs +++ b/MediaBrowser.Controller/Providers/DirectoryService.cs @@ -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; } diff --git a/MediaBrowser.Controller/Providers/IDirectoryService.cs b/MediaBrowser.Controller/Providers/IDirectoryService.cs index 1babf73af8..8a3fa33da3 100644 --- a/MediaBrowser.Controller/Providers/IDirectoryService.cs +++ b/MediaBrowser.Controller/Providers/IDirectoryService.cs @@ -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); } |
