Use typed UserManager GetPreference

This commit is contained in:
crobibero 2020-12-11 15:04:14 -07:00
parent b670937c3d
commit f5cce9e630

View File

@ -186,13 +186,10 @@ namespace MediaBrowser.Controller.Entities
{ {
if (this is ICollectionFolder && !(this is BasePluginFolder)) if (this is ICollectionFolder && !(this is BasePluginFolder))
{ {
var blockedMediaFolders = user.GetPreference(PreferenceKind.BlockedMediaFolders); var blockedMediaFolders = user.GetPreference<Guid>(PreferenceKind.BlockedMediaFolders);
if (blockedMediaFolders.Length > 0) if (blockedMediaFolders.Length > 0)
{ {
if (blockedMediaFolders.Contains(Id.ToString("N", CultureInfo.InvariantCulture), StringComparer.OrdinalIgnoreCase) || if (blockedMediaFolders.Contains(Id))
// Backwards compatibility
blockedMediaFolders.Contains(Name, StringComparer.OrdinalIgnoreCase))
{ {
return false; return false;
} }
@ -200,8 +197,7 @@ namespace MediaBrowser.Controller.Entities
else else
{ {
if (!user.HasPermission(PermissionKind.EnableAllFolders) if (!user.HasPermission(PermissionKind.EnableAllFolders)
&& !user.GetPreference(PreferenceKind.EnabledFolders) && !user.GetPreference<Guid>(PreferenceKind.EnabledFolders).Contains(Id))
.Contains(Id.ToString("N", CultureInfo.InvariantCulture), StringComparer.OrdinalIgnoreCase))
{ {
return false; return false;
} }