From 6c1bfe661bf2d0c2e988793bd760148d57014bb4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 19 Apr 2013 14:03:21 -0400 Subject: tighter control of shortcuts --- MediaBrowser.Controller/IO/FileData.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.Controller/IO/FileData.cs') diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.cs index 7cefcd71a..4571c1ad0 100644 --- a/MediaBrowser.Controller/IO/FileData.cs +++ b/MediaBrowser.Controller/IO/FileData.cs @@ -21,11 +21,12 @@ namespace MediaBrowser.Controller.IO /// if set to true [include files]. /// if set to true [include directories]. /// The flatten folder depth. + /// if set to true [resolve shortcuts]. /// The args. /// Dictionary{System.StringWIN32_FIND_DATA}. /// /// GetFileSystemEntries failed - public static Dictionary GetFilteredFileSystemEntries(string path, ILogger logger, string searchPattern = "*", bool includeFiles = true, bool includeDirectories = true, int flattenFolderDepth = 0, ItemResolveArgs args = null) + public static Dictionary GetFilteredFileSystemEntries(string path, ILogger logger, string searchPattern = "*", bool includeFiles = true, bool includeDirectories = true, int flattenFolderDepth = 0, bool resolveShortcuts = true, ItemResolveArgs args = null) { if (string.IsNullOrEmpty(path)) { @@ -80,7 +81,7 @@ namespace MediaBrowser.Controller.IO lpFindFileData.Path = Path.Combine(path, lpFindFileData.cFileName); - if (FileSystem.IsShortcut(lpFindFileData.Path)) + if (resolveShortcuts && FileSystem.IsShortcut(lpFindFileData.Path)) { var newPath = FileSystem.ResolveShortcut(lpFindFileData.Path); if (string.IsNullOrWhiteSpace(newPath)) @@ -110,7 +111,7 @@ namespace MediaBrowser.Controller.IO } else if (flattenFolderDepth > 0 && lpFindFileData.IsDirectory) { - foreach (var child in GetFilteredFileSystemEntries(lpFindFileData.Path, logger, flattenFolderDepth: flattenFolderDepth - 1)) + foreach (var child in GetFilteredFileSystemEntries(lpFindFileData.Path, logger, flattenFolderDepth: flattenFolderDepth - 1, resolveShortcuts: resolveShortcuts)) { dict[child.Key] = child.Value; } -- cgit v1.2.3