From 8c60d2b9600662d593b57024ee1f1e206153b0e5 Mon Sep 17 00:00:00 2001 From: Karl Besser Date: Fri, 20 Sep 2024 22:59:59 -0400 Subject: [PATCH] Add parentheses as delimiters for feat. detection When checking whether a title or artist contains a feature, it now also detects them when they are in parentheses or brackets, i.e., "Song Name (feat. XYZ)" will return true. --- beets/plugins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beets/plugins.py b/beets/plugins.py index 0864c4b9b..fba321f43 100644 --- a/beets/plugins.py +++ b/beets/plugins.py @@ -518,7 +518,7 @@ def feat_tokens(for_artist=True): feat_words = ["ft", "featuring", "feat", "feat.", "ft."] if for_artist: feat_words += ["with", "vs", "and", "con", "&"] - return r"(?<=\s)(?:{})(?=\s)".format( + return r"(?<=[\s,(,\[])(?:{})(?=\s)".format( "|".join(re.escape(x) for x in feat_words) )