update FindByPath to not check PhysicalLocations for remote items

This commit is contained in:
Luke Pulverenti 2013-12-08 15:19:52 -05:00
parent f856e166ff
commit baf6c3efc7

View File

@ -1359,13 +1359,24 @@ namespace MediaBrowser.Controller.Entities
Logger.ErrorException("Error getting ResolveArgs for {0}", ex, Path); 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 => return RecursiveChildren.Where(i => i.LocationType != LocationType.Virtual).FirstOrDefault(i =>
{ {
try try
{ {
return string.Equals(i.Path, path, StringComparison.OrdinalIgnoreCase) if (string.Equals(i.Path, path, StringComparison.OrdinalIgnoreCase))
|| i.ResolveArgs.PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase); {
return true;
}
if (i.LocationType != LocationType.Remote)
{
if (i.ResolveArgs.PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase))
{
return true;
}
}
return false;
} }
catch (IOException ex) catch (IOException ex)
{ {