fix: Consider Spotify's upc padding

This commit is contained in:
Xoconoch
2025-08-25 07:41:56 -06:00
parent bd393805a8
commit ed3375d8ba

View File

@@ -527,7 +527,7 @@ class DeeLogin:
spo_artists = spotify_album_data.get('artists') or []
spo_main_artist = (spo_artists[0].get('name') if spo_artists else '') or ''
external_ids = spotify_album_data.get('external_ids') or {}
spo_upc = str(external_ids.get('upc') or '').strip()
spo_upc = str(external_ids.get('upc') or '').strip().lstrip('0')
# Try UPC first
if spo_upc:
@@ -555,7 +555,7 @@ class DeeLogin:
dzc = API.get_album_json(str(c_id))
except Exception:
continue
upc = str(dzc.get('upc') or '').strip()
upc = str(dzc.get('upc') or '').strip().lstrip('0')
if spo_upc and upc and spo_upc != upc:
continue
link_dee = f"https://www.deezer.com/album/{c_id}"