瀏覽代碼

update directory service

Luke Pulverenti 9 年之前
父節點
當前提交
c3d8115bc8
共有 1 個文件被更改,包括 23 次插入22 次删除
  1. 23 22
      MediaBrowser.Controller/Providers/DirectoryService.cs

+ 23 - 22
MediaBrowser.Controller/Providers/DirectoryService.cs

@@ -100,28 +100,29 @@ namespace MediaBrowser.Controller.Providers
 
         public FileSystemMetadata GetFile(string path)
         {
-            var directory = Path.GetDirectoryName(path);
-
-            if (string.IsNullOrWhiteSpace(directory))
-            {
-                _logger.Debug("Parent path is null for {0}", path);
-                return null;
-            }
-
-            try
-            {
-                var dict = GetFileSystemDictionary(directory, false);
-
-                FileSystemMetadata entry;
-                dict.TryGetValue(path, out entry);
-
-                return entry;
-            }
-            catch (Exception ex)
-            {
-                _logger.ErrorException("Error in GetFileSystemDictionary. Directory: :{0}. Original path: {1}", ex, directory, path);
-                return null;
-            }
+            return _fileSystem.GetFileInfo(path);
+            //var directory = Path.GetDirectoryName(path);
+
+            //if (string.IsNullOrWhiteSpace(directory))
+            //{
+            //    _logger.Debug("Parent path is null for {0}", path);
+            //    return null;
+            //}
+
+            //try
+            //{
+            //    var dict = GetFileSystemDictionary(directory, false);
+
+            //    FileSystemMetadata entry;
+            //    dict.TryGetValue(path, out entry);
+
+            //    return entry;
+            //}
+            //catch (Exception ex)
+            //{
+            //    _logger.ErrorException("Error in GetFileSystemDictionary. Directory: :{0}. Original path: {1}", ex, directory, path);
+            //    return null;
+            //}
         }
 
         public IEnumerable<FileSystemMetadata> GetDirectories(string path)