浏览代码

improve offline support and add a web client indicator

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

+ 4 - 4
MediaBrowser.Controller/Entities/BaseItem.cs

@@ -1,5 +1,4 @@
-using MediaBrowser.Common.Extensions;
-using MediaBrowser.Controller.Configuration;
+using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Localization;
 using MediaBrowser.Controller.Localization;
@@ -13,7 +12,6 @@ using System.Collections.Generic;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
 using System.Runtime.Serialization;
 using System.Runtime.Serialization;
-using System.Text;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
@@ -320,9 +318,12 @@ namespace MediaBrowser.Controller.Entities
 
 
             if (pathInfo == null || !pathInfo.Exists)
             if (pathInfo == null || !pathInfo.Exists)
             {
             {
+                IsOffline = true;
                 throw new IOException("Unable to retrieve file system info for " + path);
                 throw new IOException("Unable to retrieve file system info for " + path);
             }
             }
 
 
+            IsOffline = false;
+
             var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths)
             var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths)
             {
             {
                 FileInfo = pathInfo,
                 FileInfo = pathInfo,
@@ -331,7 +332,6 @@ namespace MediaBrowser.Controller.Entities
             };
             };
 
 
             // Gather child folder and files
             // Gather child folder and files
-
             if (args.IsDirectory)
             if (args.IsDirectory)
             {
             {
                 var isPhysicalRoot = args.IsPhysicalRoot;
                 var isPhysicalRoot = args.IsPhysicalRoot;

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

@@ -635,8 +635,10 @@ namespace MediaBrowser.Controller.Entities
         /// <returns>Task.</returns>
         /// <returns>Task.</returns>
         protected async virtual Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool? recursive = null, bool forceRefreshMetadata = false)
         protected async virtual Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool? recursive = null, bool forceRefreshMetadata = false)
         {
         {
+            var locationType = LocationType;
+
             // Nothing to do here
             // Nothing to do here
-            if (LocationType != LocationType.FileSystem)
+            if (locationType == LocationType.Remote || locationType == LocationType.Virtual)
             {
             {
                 return;
                 return;
             }
             }