aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Channels/Channel.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-06-14 20:15:26 -0600
committercrobibero <cody@robibe.ro>2020-06-14 20:15:26 -0600
commit589735f60ce36197be9d1c4609b0ee6e3fd3c291 (patch)
treec5dad758fee4f4eb7727780fd7eab0fa60630a71 /MediaBrowser.Controller/Channels/Channel.cs
parente2b2f74b47cc1d281c0819795b83f8d49d1f3b09 (diff)
parentf026a1d7217c69b4eeadd258980e254702f6dde6 (diff)
Merge remote-tracking branch 'upstream/master' into HEAD
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;
}