Add diacritic-normalized artist name variations
Enhances artist name matching by including diacritic-normalized variations, allowing names like 'Subcarpaţi' to match 'Subcarpati' in SQL LIKE queries. This addresses issue #101 and improves search robustness.
This commit is contained in:
parent
b269084c7d
commit
404f8b254d
1 changed files with 10 additions and 1 deletions
|
|
@ -1492,6 +1492,15 @@ class MusicDatabase:
|
||||||
variations = [artist_name]
|
variations = [artist_name]
|
||||||
name_lower = artist_name.lower()
|
name_lower = artist_name.lower()
|
||||||
|
|
||||||
|
# Add diacritic-normalized variation (fixes #101)
|
||||||
|
# This allows "Subcarpaţi" to match "Subcarpati" in SQL LIKE queries
|
||||||
|
normalized_name = self._normalize_for_comparison(artist_name)
|
||||||
|
# Only add if it's different from original (avoid duplicates)
|
||||||
|
if normalized_name != artist_name.lower():
|
||||||
|
# Add with original casing style if possible
|
||||||
|
variations.append(normalized_name.title())
|
||||||
|
variations.append(normalized_name)
|
||||||
|
|
||||||
# Add more aliases here in the future
|
# Add more aliases here in the future
|
||||||
if "korn" in name_lower:
|
if "korn" in name_lower:
|
||||||
if "KoЯn" not in variations:
|
if "KoЯn" not in variations:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue