aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/BaseItem.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-04-05 23:47:01 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-04-05 23:47:01 -0400
commit3cc0ad2a3599de1134b97057f14000ea9523fa3d (patch)
treee89815755fbb612017e209d3b40fbb1442dde060 /MediaBrowser.Controller/Entities/BaseItem.cs
parent30104bd8de62715d127823e69dc0de9e65d99840 (diff)
add notification services tab
Diffstat (limited to 'MediaBrowser.Controller/Entities/BaseItem.cs')
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs14
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>