aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Channels/Channel.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-06-24 10:52:39 -0600
committercrobibero <cody@robibe.ro>2020-06-24 10:52:39 -0600
commitcbcf3bfaffadf9d467b2bd0bb7f3e834d13d56d3 (patch)
tree60c33f03ed003794eb61058ff870dc4f2dbee64d /MediaBrowser.Controller/Channels/Channel.cs
parent8f1505cdf5bc964c294cf0575807233f0e7af7d7 (diff)
parent6ad50f2e023cdf8fedce8c828c507576d590858e (diff)
Merge remote-tracking branch 'upstream/api-migration' into api-channel
Diffstat (limited to 'MediaBrowser.Controller/Channels/Channel.cs')
-rw-r--r--MediaBrowser.Controller/Channels/Channel.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/Channels/Channel.cs b/MediaBrowser.Controller/Channels/Channel.cs
index cdf2ca69e..dbb047804 100644
--- a/MediaBrowser.Controller/Channels/Channel.cs
+++ b/MediaBrowser.Controller/Channels/Channel.cs
@@ -3,6 +3,8 @@ using System.Globalization;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading;
+using Jellyfin.Data.Entities;
+using Jellyfin.Data.Enums;
using MediaBrowser.Common.Progress;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Querying;
@@ -13,16 +15,18 @@ namespace MediaBrowser.Controller.Channels
{
public override bool IsVisible(User user)
{
- if (user.Policy.BlockedChannels != null)
+ if (user.GetPreference(PreferenceKind.BlockedChannels) != null)
{
- if (user.Policy.BlockedChannels.Contains(Id.ToString("N", CultureInfo.InvariantCulture), StringComparer.OrdinalIgnoreCase))
+ if (user.GetPreference(PreferenceKind.BlockedChannels).Contains(Id.ToString("N", CultureInfo.InvariantCulture), StringComparer.OrdinalIgnoreCase))
{
return false;
}
}
else
{
- if (!user.Policy.EnableAllChannels && !user.Policy.EnabledChannels.Contains(Id.ToString("N", CultureInfo.InvariantCulture), StringComparer.OrdinalIgnoreCase))
+ if (!user.HasPermission(PermissionKind.EnableAllChannels)
+ && !user.GetPreference(PreferenceKind.EnabledChannels)
+ .Contains(Id.ToString("N", CultureInfo.InvariantCulture), StringComparer.OrdinalIgnoreCase))
{
return false;
}