From a1469791b0e2ed70d4526b4dc1fc0cb96b08fa28 Mon Sep 17 00:00:00 2001 From: They Who Shall Be Named <93336740+theywhoshallbenamed@users.noreply.github.com> Date: Sat, 16 Aug 2025 04:11:01 -0400 Subject: [PATCH] Change fallback query to add artist and use Deezer's advanced search Including artist name ensures that tracks with identical titles and album titles don't get included in results. Deezer advanced search provides more accurate results. --- deezspot/deezloader/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/deezspot/deezloader/__init__.py b/deezspot/deezloader/__init__.py index 058a3b7..3c66cf0 100644 --- a/deezspot/deezloader/__init__.py +++ b/deezspot/deezloader/__init__.py @@ -419,7 +419,9 @@ class DeeLogin: spo_title = track_json.get('name', '') spo_album_title = (track_json.get('album') or {}).get('name', '') spo_tracknum = int(track_json.get('track_number') or 0) - + spo_artists = track_json.get('artists') or [] + spo_main_artist = (spo_artists[0].get('name') if spo_artists else '') or '' + try: dz = API.get_track_json(f"isrc:{spo_isrc}") if dz and dz.get('id'): @@ -435,8 +437,8 @@ class DeeLogin: except Exception: pass - # Fallback: search by title + album - query = f'"{spo_title} {spo_album_title}"' + # Fallback: search by title + artist + album + query = f'"track:\'{spo_title}\' artist:\'{spo_main_artist}\' album:\'{spo_album_title}\'"' try: candidates = API.search_tracks_raw(query, limit=5) except Exception: