The Free Software Media System - Server Backend & API
don't try to get non-cached children when offline
Luke Pulverentideeb85f2962f
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex dff0203b9e..0104db305f 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -314,7 +314,15 @@ namespace MediaBrowser.Controller.EntitiesisDirectory = 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.csindex e782717e91..8605c71257 100644--- a/MediaBrowser.Controller/Entities/Folder.cs+++ b/MediaBrowser.Controller/Entities/Folder.cs@@ -646,7 +646,7 @@ namespace MediaBrowser.Controller.EntitiescancellationToken.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.Entitieselse{item.IsOffline = true;++ validChildren.Add(new Tuple<BaseItem, bool>(item, false));}}