From 16bc3a6d773ade03cad5d86eb317163ed827f17b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 11 Feb 2014 16:41:01 -0500 Subject: implement fetcher priority adjustment --- 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 270afd89a..4ee8a810b 100644 --- a/MediaBrowser.Controller/IO/FileData.cs +++ b/MediaBrowser.Controller/IO/FileData.cs @@ -1,5 +1,6 @@ using MediaBrowser.Common.IO; using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; @@ -15,16 +16,16 @@ namespace MediaBrowser.Controller.IO /// /// Gets the filtered file system entries. /// + /// The directory service. /// The path. /// The file system. /// The logger. /// The args. - /// The search pattern. /// The flatten folder depth. /// if set to true [resolve shortcuts]. /// Dictionary{System.StringFileSystemInfo}. /// path - public static Dictionary GetFilteredFileSystemEntries(string path, IFileSystem fileSystem, ILogger logger, ItemResolveArgs args, string searchPattern = "*", int flattenFolderDepth = 0, bool resolveShortcuts = true) + public static Dictionary GetFilteredFileSystemEntries(IDirectoryService directoryService, string path, IFileSystem fileSystem, ILogger logger, ItemResolveArgs args, int flattenFolderDepth = 0, bool resolveShortcuts = true) { if (string.IsNullOrEmpty(path)) { @@ -35,7 +36,7 @@ namespace MediaBrowser.Controller.IO throw new ArgumentNullException("args"); } - var entries = new DirectoryInfo(path).EnumerateFileSystemInfos(searchPattern, SearchOption.TopDirectoryOnly); + var entries = directoryService.GetFileSystemEntries(path); if (!resolveShortcuts && flattenFolderDepth == 0) { @@ -79,7 +80,7 @@ namespace MediaBrowser.Controller.IO } else if (flattenFolderDepth > 0 && isDirectory) { - foreach (var child in GetFilteredFileSystemEntries(fullName, fileSystem, logger, args, flattenFolderDepth: flattenFolderDepth - 1, resolveShortcuts: resolveShortcuts)) + foreach (var child in GetFilteredFileSystemEntries(directoryService, fullName, fileSystem, logger, args, flattenFolderDepth: flattenFolderDepth - 1, resolveShortcuts: resolveShortcuts)) { dict[child.Key] = child.Value; } -- cgit v1.2.3