diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-20 11:51:25 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-20 11:51:25 -0500 |
| commit | 33e1e5367317c70588373fc5a1c1f619c73c9a80 (patch) | |
| tree | eca1f4cae901c66d6889ccd67e454fde83cba6b9 | |
| parent | 7881a4be0af65148128a5d63f9997937178f139e (diff) | |
handle errors getting physical paths of an item
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryService.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 843e39f78..f3d5824da 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -1,6 +1,7 @@ using MediaBrowser.Common; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; +using MediaBrowser.Model.Entities; using ServiceStack; using System; using System.Collections.Generic; @@ -67,7 +68,27 @@ namespace MediaBrowser.Api.Library /// <returns>System.Object.</returns> public object Get(GetPhyscialPaths request) { - var result = _libraryManager.RootFolder.Children.SelectMany(c => c.ResolveArgs.PhysicalLocations).ToList(); + var result = _libraryManager.RootFolder.Children + .SelectMany(c => + { + var locationType = c.LocationType; + + if (locationType != LocationType.Remote && locationType != LocationType.Virtual) + { + try + { + return c.ResolveArgs.PhysicalLocations; + } + catch (Exception ex) + { + Logger.ErrorException("Error getting ResolveArgs for {0}", ex, c.Path); + } + + } + + return new List<string>(); + }) + .ToList(); return ToOptimizedResult(result); } |
