aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-07-05 14:23:41 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-07-05 14:23:41 -0400
commitdeeb85f2962fdcfaf56e4e2e7f72aac8acb6efc3 (patch)
tree26dd386f46592f1ca9cb320fec4d83b69b8dd8bb
parent6b84095adda46ed430c4552590d00d5841d953cc (diff)
don't try to get non-cached children when offline
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs10
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs4
2 files changed, 12 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index dff0203b9..0104db305 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -314,7 +314,15 @@ namespace MediaBrowser.Controller.Entities
isDirectory = true;
}
- pathInfo = pathInfo ?? (isDirectory ? new DirectoryInfo(path) : FileSystem.GetFileSystemInfo(path));
+ try
+ {
+ pathInfo = pathInfo ?? (isDirectory ? new DirectoryInfo(path) : FileSystem.GetFileSystemInfo(path));
+ }
+ catch (IOException)
+ {
+ IsOffline = true;
+ throw;
+ }
if (pathInfo == null || !pathInfo.Exists)
{
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index e782717e9..8605c7125 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -646,7 +646,7 @@ namespace MediaBrowser.Controller.Entities
cancellationToken.ThrowIfCancellationRequested();
//get the current valid children from filesystem (or wherever)
- var nonCachedChildren = GetNonCachedChildren();
+ var nonCachedChildren = IsOffline ? new BaseItem[] { } : GetNonCachedChildren();
if (nonCachedChildren == null) return; //nothing to validate
@@ -722,6 +722,8 @@ namespace MediaBrowser.Controller.Entities
else
{
item.IsOffline = true;
+
+ validChildren.Add(new Tuple<BaseItem, bool>(item, false));
}
}