From 45ba51ce3cb4485447928207d7eec698051b59ce Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Sun, 12 Apr 2026 15:26:21 -0700 Subject: [PATCH] Add diacritic-insensitive matching to library artist search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit search_artists now uses unidecode_lower() and _normalize_for_comparison() so 'Tiesto' finds 'Tiësto'. Track search already had this — artist search was the only gap. No change to stored data, only the comparison. --- database/music_database.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/database/music_database.py b/database/music_database.py index 34affa00..2db8751d 100644 --- a/database/music_database.py +++ b/database/music_database.py @@ -4888,25 +4888,27 @@ class MusicDatabase: return [] def search_artists(self, query: str, limit: int = 50, server_source: str = None) -> List[DatabaseArtist]: - """Search artists by name, optionally filtered by server source.""" + """Search artists by name, optionally filtered by server source. + Uses diacritic-insensitive matching so 'Tiesto' finds 'Tiësto'.""" try: conn = self._get_connection() cursor = conn.cursor() + norm_query = f"%{self._normalize_for_comparison(query)}%" if server_source: cursor.execute(""" SELECT * FROM artists - WHERE name LIKE ? AND server_source = ? + WHERE unidecode_lower(name) LIKE ? AND server_source = ? ORDER BY name LIMIT ? - """, (f"%{query}%", server_source, limit)) + """, (norm_query, server_source, limit)) else: cursor.execute(""" SELECT * FROM artists - WHERE name LIKE ? + WHERE unidecode_lower(name) LIKE ? ORDER BY name LIMIT ? - """, (f"%{query}%", limit)) + """, (norm_query, limit)) rows = cursor.fetchall()