From cb61a57e828f1e35b32cdb020a57bb4df35a5b3a Mon Sep 17 00:00:00 2001 From: Jpuc1143 <80900349+Jpuc1143@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:45:40 -0300 Subject: [PATCH] Reduced number of calls to GetPreference() Co-authored-by: Cody Robibero --- MediaBrowser.Controller/Entities/BaseItem.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 0cd972054..3d683052f 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1607,7 +1607,8 @@ namespace MediaBrowser.Controller.Entities return false; } - if (user.GetPreference(PreferenceKind.AllowedTags).Any() && !user.GetPreference(PreferenceKind.AllowedTags).Any(i => Tags.Contains(i, StringComparison.OrdinalIgnoreCase))) + var allowedTagsPreference = user.GetPreference(PreferenceKind.AllowedTags); + if (allowedTagsPreference.Any() && !allowedTagsPreference.Any(i => Tags.Contains(i, StringComparison.OrdinalIgnoreCase))) { return false; }