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