diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-05-04 14:14:45 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-05-04 14:14:45 -0400 |
| commit | 696a6b34eaaee1fc906d27a968d392b7b7193c41 (patch) | |
| tree | 96b3cd854c519488bf91ed477dcb6d802a9473c9 /MediaBrowser.Controller/Entities/Folder.cs | |
| parent | 53024bd149c7f8e96adf86a9fb5e3cf00c883ba8 (diff) | |
improve smb support
Diffstat (limited to 'MediaBrowser.Controller/Entities/Folder.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 268fefbd3..edac27f99 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -640,7 +640,7 @@ namespace MediaBrowser.Controller.Entities return true; } - path = System.IO.Path.GetDirectoryName(path); + path = FileSystem.GetDirectoryName(path); } return allLibraryPaths.Any(i => ContainsPath(i, originalPath)); @@ -1206,11 +1206,17 @@ namespace MediaBrowser.Controller.Entities return GetLinkedChildren(); } - var locations = user.RootFolder - .Children + if (LinkedChildren.Count == 0) + { + return new List<BaseItem>(); + } + + var allUserRootChildren = user.RootFolder.Children.OfType<Folder>().ToList(); + + var collectionFolderIds = allUserRootChildren .OfType<CollectionFolder>() .Where(i => i.IsVisible(user)) - .SelectMany(i => i.PhysicalLocations) + .Select(i => i.Id) .ToList(); return LinkedChildren @@ -1228,9 +1234,16 @@ namespace MediaBrowser.Controller.Entities return null; } } - else if (childLocationType == LocationType.FileSystem && !locations.Any(l => FileSystem.ContainsSubPath(l, child.Path))) + else if (childLocationType == LocationType.FileSystem) { - return null; + var itemCollectionFolderIds = + LibraryManager.GetCollectionFolders(child, allUserRootChildren) + .Select(f => f.Id).ToList(); + + if (!itemCollectionFolderIds.Any(collectionFolderIds.Contains)) + { + return null; + } } } @@ -1323,7 +1336,7 @@ namespace MediaBrowser.Controller.Entities } else { newShortcutLinks = new List<LinkedChild>(); } - if (!newShortcutLinks.SequenceEqual(currentShortcutLinks, new LinkedChildComparer())) + if (!newShortcutLinks.SequenceEqual(currentShortcutLinks, new LinkedChildComparer(FileSystem))) { Logger.Info("Shortcut links have changed for {0}", Path); |
