From baf6c3efc7c0e69fce776072ce282c23a69bc1d3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 8 Dec 2013 15:19:52 -0500 Subject: [PATCH] update FindByPath to not check PhysicalLocations for remote items --- MediaBrowser.Controller/Entities/Folder.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index e7593b075..1d38b3728 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -1359,13 +1359,24 @@ namespace MediaBrowser.Controller.Entities Logger.ErrorException("Error getting ResolveArgs for {0}", ex, Path); } - //this should be functionally equivilent to what was here since it is IEnum and works on a thread-safe copy return RecursiveChildren.Where(i => i.LocationType != LocationType.Virtual).FirstOrDefault(i => { try { - return string.Equals(i.Path, path, StringComparison.OrdinalIgnoreCase) - || i.ResolveArgs.PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase); + if (string.Equals(i.Path, path, StringComparison.OrdinalIgnoreCase)) + { + return true; + } + + if (i.LocationType != LocationType.Remote) + { + if (i.ResolveArgs.PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase)) + { + return true; + } + } + + return false; } catch (IOException ex) {