From d2c1e24ff76603a154b29c38d298a3ea2e5221d2 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Sun, 8 Mar 2026 13:17:18 -0700 Subject: [PATCH] Fix ampersand in artist names breaking search queries --- core/matching_engine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/matching_engine.py b/core/matching_engine.py index bc7ec1ed..b532a640 100644 --- a/core/matching_engine.py +++ b/core/matching_engine.py @@ -88,7 +88,8 @@ class MusicMatchingEngine: # Replace common separators with spaces to preserve word boundaries. # Include hyphen in separator replacement for artist names like "AC/DC" vs "AC-DC" - text = re.sub(r'[._/-]', ' ', text) + # Include '&' so "Pig&Dan" becomes "Pig Dan" (matches "Pig & Dan" on Soulseek) + text = re.sub(r'[._/&-]', ' ', text) # Keep alphanumeric characters, spaces, AND the '$' sign. text = re.sub(r'[^a-z0-9\s$]', '', text)