diff options
| author | crobibero <cody@robibe.ro> | 2020-09-11 15:53:04 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-09-11 15:53:04 -0600 |
| commit | f13b87afa3e81e7fa2710caec58a7d6cb20f7635 (patch) | |
| tree | 0f269ac5baa27b334c5377d9dec4010aedf25183 /MediaBrowser.Controller/IO/FileData.cs | |
| parent | 2363ad544979adf32207fa927f106fadb784f1fb (diff) | |
| parent | 6bf0acb854683377bebad3ca27de17706519c420 (diff) | |
Merge remote-tracking branch 'upstream/master' into api-upload-subtitle
Diffstat (limited to 'MediaBrowser.Controller/IO/FileData.cs')
| -rw-r--r-- | MediaBrowser.Controller/IO/FileData.cs | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.cs index 4bbb60283..9bc4cac39 100644 --- a/MediaBrowser.Controller/IO/FileData.cs +++ b/MediaBrowser.Controller/IO/FileData.cs @@ -8,34 +8,25 @@ using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.IO { /// <summary> - /// Provides low level File access that is much faster than the File/Directory api's + /// Provides low level File access that is much faster than the File/Directory api's. /// </summary> public static class FileData { - private static Dictionary<string, FileSystemMetadata> GetFileSystemDictionary(FileSystemMetadata[] list) - { - var dict = new Dictionary<string, FileSystemMetadata>(StringComparer.OrdinalIgnoreCase); - - foreach (var file in list) - { - dict[file.FullName] = file; - } - return dict; - } - /// <summary> /// Gets the filtered file system entries. /// </summary> /// <param name="directoryService">The directory service.</param> /// <param name="path">The path.</param> /// <param name="fileSystem">The file system.</param> + /// <param name="appHost">The application host.</param> /// <param name="logger">The logger.</param> /// <param name="args">The args.</param> /// <param name="flattenFolderDepth">The flatten folder depth.</param> /// <param name="resolveShortcuts">if set to <c>true</c> [resolve shortcuts].</param> /// <returns>Dictionary{System.StringFileSystemInfo}.</returns> /// <exception cref="ArgumentNullException">path</exception> - public static FileSystemMetadata[] GetFilteredFileSystemEntries(IDirectoryService directoryService, + public static FileSystemMetadata[] GetFilteredFileSystemEntries( + IDirectoryService directoryService, string path, IFileSystem fileSystem, IServerApplicationHost appHost, @@ -48,6 +39,7 @@ namespace MediaBrowser.Controller.IO { throw new ArgumentNullException(nameof(path)); } + if (args == null) { throw new ArgumentNullException(nameof(args)); @@ -76,7 +68,7 @@ namespace MediaBrowser.Controller.IO if (string.IsNullOrEmpty(newPath)) { - //invalid shortcut - could be old or target could just be unavailable + // invalid shortcut - could be old or target could just be unavailable logger.LogWarning("Encountered invalid shortcut: " + fullName); continue; } @@ -115,9 +107,9 @@ namespace MediaBrowser.Controller.IO returnResult[index] = value; index++; } + return returnResult; } - } } |
