From 5437936bb91efa8a38bfcb15a39e29f08148683f Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Mon, 25 Mar 2024 07:15:24 -0600 Subject: [PATCH] Check all tags for allow/block (#11206) --- MediaBrowser.Controller/Entities/BaseItem.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index cb9a8cad8..ac9698ec9 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1586,18 +1586,24 @@ namespace MediaBrowser.Controller.Entities list.AddRange(parent.Tags); } + foreach (var folder in LibraryManager.GetCollectionFolders(this)) + { + list.AddRange(folder.Tags); + } + return list.Distinct(StringComparer.OrdinalIgnoreCase).ToList(); } private bool IsVisibleViaTags(User user) { - if (user.GetPreference(PreferenceKind.BlockedTags).Any(i => Tags.Contains(i, StringComparison.OrdinalIgnoreCase))) + var allTags = GetInheritedTags(); + if (user.GetPreference(PreferenceKind.BlockedTags).Any(i => allTags.Contains(i, StringComparison.OrdinalIgnoreCase))) { return false; } var allowedTagsPreference = user.GetPreference(PreferenceKind.AllowedTags); - if (allowedTagsPreference.Any() && !allowedTagsPreference.Any(i => Tags.Contains(i, StringComparison.OrdinalIgnoreCase))) + if (allowedTagsPreference.Length != 0 && !allowedTagsPreference.Any(i => allTags.Contains(i, StringComparison.OrdinalIgnoreCase))) { return false; }