diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index 4574ca3e9..b6b4a82e9 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -73,26 +73,11 @@ namespace MediaBrowser.Controller.Entities { get { - Dictionary folderIds; - - try - { - // Accessing ResolveArgs could involve file system access - folderIds = ResolveArgs.PhysicalLocations - .Select(f => f.GetMBId(typeof(Folder))) - .ToDictionary(i => i); - } - catch (IOException ex) - { - Logger.ErrorException("Error creating FolderIds for {0}", ex, Path); - - folderIds = new Dictionary(); - } var ourChildren = - LibraryManager.RootFolder.RecursiveChildren.OfType() - .Where(i => folderIds.ContainsKey(i.Id)) - .SelectMany(c => c.Children); + LibraryManager.RootFolder.RecursiveChildren + .Where(i => i is Folder && i.Path != null && ResolveArgs.PhysicalLocations.Contains(i.Path, StringComparer.OrdinalIgnoreCase)) + .Cast().SelectMany(c => c.Children); return new ConcurrentDictionary(ourChildren.ToDictionary(i => i.Id)); }