From 35d9b29c97379b40a6ba4554bd066cc2c25217ee Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 11 Jun 2013 16:35:54 -0400 Subject: fixed issue of not seeing network shares --- .../Library/LibraryManager.cs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs') diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index fb05c8c43..bc122ff6d 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -446,24 +446,21 @@ namespace MediaBrowser.Server.Implementations.Library /// /// Resolves a path into a BaseItem /// - /// The path. - /// The parent. /// The file info. + /// The parent. /// BaseItem. /// - public BaseItem ResolvePath(string path, Folder parent = null, FileSystemInfo fileInfo = null) + public BaseItem ResolvePath(FileSystemInfo fileInfo, Folder parent = null) { - if (string.IsNullOrEmpty(path)) + if (fileInfo == null) { - throw new ArgumentNullException(); + throw new ArgumentNullException("fileInfo"); } - fileInfo = fileInfo ?? FileSystem.GetFileSystemInfo(path); - var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths) { Parent = parent, - Path = path, + Path = fileInfo.FullName, FileInfo = fileInfo }; @@ -534,7 +531,7 @@ namespace MediaBrowser.Server.Implementations.Library { try { - var item = ResolvePath(f.FullName, parent, f) as T; + var item = ResolvePath(f, parent) as T; if (item != null) { @@ -567,7 +564,7 @@ namespace MediaBrowser.Server.Implementations.Library Directory.CreateDirectory(rootFolderPath); } - var rootFolder = RetrieveItem(rootFolderPath.GetMBId(typeof(AggregateFolder))) as AggregateFolder ?? (AggregateFolder)ResolvePath(rootFolderPath); + var rootFolder = RetrieveItem(rootFolderPath.GetMBId(typeof(AggregateFolder))) as AggregateFolder ?? (AggregateFolder)ResolvePath(new DirectoryInfo(rootFolderPath)); // Add in the plug-in folders foreach (var child in PluginFolderCreators) @@ -585,7 +582,7 @@ namespace MediaBrowser.Server.Implementations.Library /// UserRootFolder. public UserRootFolder GetUserRootFolder(string userRootPath) { - return _userRootFolders.GetOrAdd(userRootPath, key => RetrieveItem(userRootPath.GetMBId(typeof(UserRootFolder))) as UserRootFolder ?? (UserRootFolder)ResolvePath(userRootPath)); + return _userRootFolders.GetOrAdd(userRootPath, key => RetrieveItem(userRootPath.GetMBId(typeof(UserRootFolder))) as UserRootFolder ?? (UserRootFolder)ResolvePath(new DirectoryInfo(userRootPath))); } /// -- cgit v1.2.3