diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-07-07 11:53:38 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-07-07 11:53:38 -0400 |
| commit | d62e63acb8a1650a8e94428c1cd5d08f0818cd9d (patch) | |
| tree | 6d23e7dbf0a7c11cf20e2865e20950f33e4ed952 /MediaBrowser.Controller/Entities/BaseItem.cs | |
| parent | 16b58256c4bee95f95e3deb2a1458235c3f4bb7c (diff) | |
Offline fixes
Diffstat (limited to 'MediaBrowser.Controller/Entities/BaseItem.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 05ab35d9a..154765325 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -263,11 +263,12 @@ namespace MediaBrowser.Controller.Entities try { LazyInitializer.EnsureInitialized(ref _resolveArgs, ref _resolveArgsInitialized, ref _resolveArgsSyncLock, () => CreateResolveArgs()); - } catch (IOException ex) { - Logger.ErrorException("Error creating resolve args for ", ex, Path); + Logger.ErrorException("Error creating resolve args for {0}", ex, Path); + + IsOffline = true; throw; } @@ -300,8 +301,7 @@ namespace MediaBrowser.Controller.Entities { var path = Path; - // non file-system entries will not have a path - if (LocationType != LocationType.FileSystem || string.IsNullOrEmpty(path)) + if (LocationType == LocationType.Remote || LocationType == LocationType.Virtual) { return new ItemResolveArgs(ConfigurationManager.ApplicationPaths); } @@ -314,24 +314,13 @@ namespace MediaBrowser.Controller.Entities isDirectory = true; } - try - { - pathInfo = pathInfo ?? (isDirectory ? new DirectoryInfo(path) : FileSystem.GetFileSystemInfo(path)); - } - catch (IOException) - { - IsOffline = true; - throw; - } + pathInfo = pathInfo ?? (isDirectory ? new DirectoryInfo(path) : FileSystem.GetFileSystemInfo(path)); if (pathInfo == null || !pathInfo.Exists) { - IsOffline = true; throw new IOException("Unable to retrieve file system info for " + path); } - IsOffline = false; - var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths) { FileInfo = pathInfo, @@ -367,6 +356,8 @@ namespace MediaBrowser.Controller.Entities //update our dates EntityResolutionHelper.EnsureDates(this, args); + IsOffline = false; + return args; } |
