From 73dcf0f2e87c7ced658c8564c583e4158a31169b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 23 Oct 2013 14:58:14 -0400 Subject: [PATCH] Restore offline functions --- MediaBrowser.Controller/Entities/Folder.cs | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 5b89eb0663..faaf2ad8b7 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -808,9 +808,15 @@ namespace MediaBrowser.Controller.Entities cancellationToken.ThrowIfCancellationRequested(); var child = currentTuple.Item1; - - //refresh it - await child.RefreshMetadata(cancellationToken, forceSave: currentTuple.Item2, forceRefresh: forceRefreshMetadata, resetResolveArgs: false).ConfigureAwait(false); + try + { + //refresh it + await child.RefreshMetadata(cancellationToken, forceSave: currentTuple.Item2, forceRefresh: forceRefreshMetadata, resetResolveArgs: false).ConfigureAwait(false); + } + catch (IOException ex) + { + Logger.ErrorException("Error refreshing {0}", ex, child.Path ?? child.Name); + } // Refresh children if a folder and the item changed or recursive is set to true var refreshChildren = child.IsFolder && (currentTuple.Item2 || (recursive.HasValue && recursive.Value)); @@ -845,8 +851,15 @@ namespace MediaBrowser.Controller.Entities await ((Folder)child).ValidateChildren(innerProgress, cancellationToken, recursive, forceRefreshMetadata).ConfigureAwait(false); - // Some folder providers are unable to refresh until children have been refreshed. - await child.RefreshMetadata(cancellationToken, resetResolveArgs: false).ConfigureAwait(false); + try + { + // Some folder providers are unable to refresh until children have been refreshed. + await child.RefreshMetadata(cancellationToken, resetResolveArgs: false).ConfigureAwait(false); + } + catch (IOException ex) + { + Logger.ErrorException("Error refreshing {0}", ex, child.Path ?? child.Name); + } } else {