From be7918e5f68f67ed32a50c2d86ee9cae79cf2b93 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 30 Oct 2013 10:40:14 -0400 Subject: fixes #567 - Deprecate native shortcut code --- MediaBrowser.Controller/IO/FileData.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'MediaBrowser.Controller/IO/FileData.cs') diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.cs index b1fc28e7b..726467fa6 100644 --- a/MediaBrowser.Controller/IO/FileData.cs +++ b/MediaBrowser.Controller/IO/FileData.cs @@ -15,6 +15,7 @@ namespace MediaBrowser.Controller.IO /// Gets the filtered file system entries. /// /// The path. + /// The file system. /// The logger. /// The args. /// The search pattern. @@ -22,7 +23,7 @@ namespace MediaBrowser.Controller.IO /// if set to true [resolve shortcuts]. /// Dictionary{System.StringFileSystemInfo}. /// path - public static Dictionary GetFilteredFileSystemEntries(string path, ILogger logger, ItemResolveArgs args, string searchPattern = "*", int flattenFolderDepth = 0, bool resolveShortcuts = true) + public static Dictionary GetFilteredFileSystemEntries(string path, IFileSystem fileSystem, ILogger logger, ItemResolveArgs args, string searchPattern = "*", int flattenFolderDepth = 0, bool resolveShortcuts = true) { if (string.IsNullOrEmpty(path)) { @@ -56,9 +57,9 @@ namespace MediaBrowser.Controller.IO var fullName = entry.FullName; - if (resolveShortcuts && FileSystem.IsShortcut(fullName)) + if (resolveShortcuts && fileSystem.IsShortcut(fullName)) { - var newPath = FileSystem.ResolveShortcut(fullName); + var newPath = fileSystem.ResolveShortcut(fullName); if (string.IsNullOrWhiteSpace(newPath)) { @@ -77,7 +78,7 @@ namespace MediaBrowser.Controller.IO } else if (flattenFolderDepth > 0 && isDirectory) { - foreach (var child in GetFilteredFileSystemEntries(fullName, logger, args, flattenFolderDepth: flattenFolderDepth - 1, resolveShortcuts: resolveShortcuts)) + foreach (var child in GetFilteredFileSystemEntries(fullName, fileSystem, logger, args, flattenFolderDepth: flattenFolderDepth - 1, resolveShortcuts: resolveShortcuts)) { dict[child.Key] = child.Value; } -- cgit v1.2.3