diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-08-09 15:59:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-09 15:59:26 -0400 |
| commit | c2996935c8a873662e6d301f139c88df8a542ed2 (patch) | |
| tree | cf405f91e893fe6a3fc20dfa1622f027666d4848 /MediaBrowser.Controller/IO/FileData.cs | |
| parent | ab834f8fdffb64b562ece0512a53f361c62f7f6f (diff) | |
| parent | 7a74c705e584774534b74e11c1ab86144cb454c6 (diff) | |
Merge pull request #2800 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Controller/IO/FileData.cs')
| -rw-r--r-- | MediaBrowser.Controller/IO/FileData.cs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.cs index 97b778d0c..64a7610fe 100644 --- a/MediaBrowser.Controller/IO/FileData.cs +++ b/MediaBrowser.Controller/IO/FileData.cs @@ -13,6 +13,17 @@ namespace MediaBrowser.Controller.IO /// </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> @@ -42,13 +53,13 @@ namespace MediaBrowser.Controller.IO throw new ArgumentNullException("args"); } + var entries = directoryService.GetFileSystemEntries(path); + if (!resolveShortcuts && flattenFolderDepth == 0) { - return directoryService.GetFileSystemDictionary(path); + return GetFileSystemDictionary(entries); } - var entries = directoryService.GetFileSystemEntries(path); - var dict = new Dictionary<string, FileSystemMetadata>(StringComparer.OrdinalIgnoreCase); foreach (var entry in entries) |
