diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-08-13 16:21:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-13 16:21:10 -0400 |
| commit | dc578f3742b474bd85d556299a6b2763f4d9acda (patch) | |
| tree | cc4a8d1de140ece77160349e51a64857656ab373 /MediaBrowser.Controller/IO/FileData.cs | |
| parent | f6ed934a7e32bf10c3a141773d713bf3b19e784f (diff) | |
| parent | 7f200f057d33e3ef52b1b1b1bf1767577295317e (diff) | |
Merge pull request #2815 from MediaBrowser/beta
Beta
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) |
