aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Channels/Channel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Channels/Channel.cs')
-rw-r--r--MediaBrowser.Controller/Channels/Channel.cs21
1 files changed, 18 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/Channels/Channel.cs b/MediaBrowser.Controller/Channels/Channel.cs
index 5a9fc3322..87d257f12 100644
--- a/MediaBrowser.Controller/Channels/Channel.cs
+++ b/MediaBrowser.Controller/Channels/Channel.cs
@@ -14,9 +14,19 @@ namespace MediaBrowser.Controller.Channels
public override bool IsVisible(User user)
{
- if (user.Policy.BlockedChannels.Contains(Id.ToString("N"), StringComparer.OrdinalIgnoreCase))
+ if (user.Policy.BlockedChannels != null)
{
- return false;
+ if (user.Policy.BlockedChannels.Contains(Id.ToString("N"), StringComparer.OrdinalIgnoreCase))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ if (!user.Policy.EnableAllChannels && !user.Policy.EnabledChannels.Contains(Id.ToString("N"), StringComparer.OrdinalIgnoreCase))
+ {
+ return false;
+ }
}
return base.IsVisible(user);
@@ -50,7 +60,12 @@ namespace MediaBrowser.Controller.Channels
protected override string GetInternalMetadataPath(string basePath)
{
- return System.IO.Path.Combine(basePath, "channels", Id.ToString("N"), "metadata");
+ return GetInternalMetadataPath(basePath, Id);
+ }
+
+ public static string GetInternalMetadataPath(string basePath, Guid id)
+ {
+ return System.IO.Path.Combine(basePath, "channels", id.ToString("N"), "metadata");
}
}
}