diacritic normalization
This commit is contained in:
parent
45500892aa
commit
c48ac1d4f9
1 changed files with 15 additions and 3 deletions
|
|
@ -2258,6 +2258,13 @@ class MusicDatabase:
|
||||||
"""Generate variations of album title to handle edition matching"""
|
"""Generate variations of album title to handle edition matching"""
|
||||||
variations = [title] # Always include original
|
variations = [title] # Always include original
|
||||||
|
|
||||||
|
# Add diacritic-normalized variation (fixes #101)
|
||||||
|
# SQLite LIKE is not Unicode-aware, so "găină" won't match "gaina"
|
||||||
|
# Adding the normalized form lets the SQL query catch both
|
||||||
|
normalized_title = self._normalize_for_comparison(title)
|
||||||
|
if normalized_title != title.lower():
|
||||||
|
variations.append(normalized_title)
|
||||||
|
|
||||||
# Clean up the title
|
# Clean up the title
|
||||||
title_lower = title.lower().strip()
|
title_lower = title.lower().strip()
|
||||||
|
|
||||||
|
|
@ -2397,6 +2404,11 @@ class MusicDatabase:
|
||||||
"""Generate variations of track title for better matching"""
|
"""Generate variations of track title for better matching"""
|
||||||
variations = [title] # Always include original
|
variations = [title] # Always include original
|
||||||
|
|
||||||
|
# Add diacritic-normalized variation (fixes #101)
|
||||||
|
normalized_title = self._normalize_for_comparison(title)
|
||||||
|
if normalized_title != title.lower():
|
||||||
|
variations.append(normalized_title)
|
||||||
|
|
||||||
# IMPORTANT: Generate bracket/dash style variations for better matching
|
# IMPORTANT: Generate bracket/dash style variations for better matching
|
||||||
# Convert "Track - Instrumental" to "Track (Instrumental)" and vice versa
|
# Convert "Track - Instrumental" to "Track (Instrumental)" and vice versa
|
||||||
if ' - ' in title:
|
if ' - ' in title:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue