浏览代码

offline support fix

Luke Pulverenti 12 年之前
父节点
当前提交
eb313459d3
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      MediaBrowser.Controller/Entities/Folder.cs

+ 3 - 5
MediaBrowser.Controller/Entities/Folder.cs

@@ -854,17 +854,15 @@ namespace MediaBrowser.Controller.Entities
         /// <returns></returns>
         private bool IsRootPathAvailable(string path)
         {
-            var parent = System.IO.Path.GetDirectoryName(path);
-
             // Depending on whether the path is local or unc, it may return either null or '\' at the top
-            while (!string.IsNullOrEmpty(parent) && !parent.ToCharArray()[0].Equals(System.IO.Path.DirectorySeparatorChar))
+            while (!string.IsNullOrEmpty(path) && path.Length > 1)
             {
-                if (Directory.Exists(parent))
+                if (Directory.Exists(path))
                 {
                     return true;
                 }
 
-                parent = System.IO.Path.GetDirectoryName(path);
+                path = System.IO.Path.GetDirectoryName(path);
             }
 
             return false;