From 2aa949e5a0f9da3e079296b376f0b8e72d3da70b Mon Sep 17 00:00:00 2001 From: Trey Turner Date: Sun, 16 Nov 2025 19:48:46 -0600 Subject: [PATCH] fix(fitintitle): simplify keyword_pattern using map() instead of list comprehension --- beetsplug/ftintitle.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/beetsplug/ftintitle.py b/beetsplug/ftintitle.py index d3d600958..4d0821593 100644 --- a/beetsplug/ftintitle.py +++ b/beetsplug/ftintitle.py @@ -106,9 +106,7 @@ def find_bracket_position( pattern = None else: # Build regex pattern to support multi-word keywords/phrases. - # Each keyword/phrase is escaped and surrounded by word boundaries at - # start and end, matching phrases like "club mix" as a whole. - keyword_pattern = "|".join(rf"\b{re.escape(kw)}\b" for kw in keywords) + keyword_pattern = rf"\b{'|'.join(map(re.escape, keywords))}\b" pattern = re.compile(keyword_pattern, re.IGNORECASE) # Bracket pairs (opening, closing)