Include track_artist in track search queries for collab/feature matching
This commit is contained in:
parent
d39db04ac0
commit
f5ac7c9261
1 changed files with 7 additions and 5 deletions
|
|
@ -4877,8 +4877,10 @@ class MusicDatabase:
|
||||||
params.append(f"%{self._normalize_for_comparison(title)}%")
|
params.append(f"%{self._normalize_for_comparison(title)}%")
|
||||||
|
|
||||||
if artist:
|
if artist:
|
||||||
where_conditions.append("unidecode_lower(artists.name) LIKE ?")
|
norm_artist = f"%{self._normalize_for_comparison(artist)}%"
|
||||||
params.append(f"%{self._normalize_for_comparison(artist)}%")
|
where_conditions.append("(unidecode_lower(artists.name) LIKE ? OR unidecode_lower(COALESCE(tracks.track_artist, '')) LIKE ?)")
|
||||||
|
params.append(norm_artist)
|
||||||
|
params.append(norm_artist)
|
||||||
|
|
||||||
# Add server filter if specified
|
# Add server filter if specified
|
||||||
if server_source:
|
if server_source:
|
||||||
|
|
@ -4925,8 +4927,8 @@ class MusicDatabase:
|
||||||
params = []
|
params = []
|
||||||
|
|
||||||
for term in search_terms[:5]: # Limit to 5 terms to avoid too broad search
|
for term in search_terms[:5]: # Limit to 5 terms to avoid too broad search
|
||||||
like_conditions.append("(unidecode_lower(tracks.title) LIKE ? OR unidecode_lower(artists.name) LIKE ?)")
|
like_conditions.append("(unidecode_lower(tracks.title) LIKE ? OR unidecode_lower(artists.name) LIKE ? OR unidecode_lower(COALESCE(tracks.track_artist, '')) LIKE ?)")
|
||||||
params.extend([f"%{term}%", f"%{term}%"])
|
params.extend([f"%{term}%", f"%{term}%", f"%{term}%"])
|
||||||
|
|
||||||
if not like_conditions:
|
if not like_conditions:
|
||||||
return []
|
return []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue