diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-07-06 21:41:04 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-07-06 21:41:04 -0400 |
| commit | eb313459d31186f785ad25e715a458ceab8d6049 (patch) | |
| tree | 11cc33997ddcf8a2748d90000bebfa544a43dde3 | |
| parent | 540b904ebaecdc935cb622ebf2e2cf87162fa3fe (diff) | |
offline support fix
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 549ce06a5..f0ea63b29 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/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; |
