diff options
Diffstat (limited to 'MediaBrowser.Controller/Entities/BaseItem.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 94fc76125..27bd09ec7 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1154,9 +1154,19 @@ namespace MediaBrowser.Controller.Entities return false; } - // TODO: Need some work here, e.g. is in user library, for channels, can user access channel, etc. + var topParent = Parents.LastOrDefault() ?? this; - return true; + if (string.IsNullOrWhiteSpace(topParent.Path)) + { + return true; + } + + var locations = user.RootFolder + .GetChildren(user, true) + .OfType<CollectionFolder>() + .SelectMany(i => i.PhysicalLocations); + + return locations.Any(l => FileSystem.ContainsSubPath(l, topParent.Path)); } /// <summary> |
