fix: Consider Spotify's upc padding
This commit is contained in:
@@ -527,7 +527,7 @@ class DeeLogin:
|
|||||||
spo_artists = spotify_album_data.get('artists') or []
|
spo_artists = spotify_album_data.get('artists') or []
|
||||||
spo_main_artist = (spo_artists[0].get('name') if spo_artists else '') or ''
|
spo_main_artist = (spo_artists[0].get('name') if spo_artists else '') or ''
|
||||||
external_ids = spotify_album_data.get('external_ids') 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
|
# Try UPC first
|
||||||
if spo_upc:
|
if spo_upc:
|
||||||
@@ -555,7 +555,7 @@ class DeeLogin:
|
|||||||
dzc = API.get_album_json(str(c_id))
|
dzc = API.get_album_json(str(c_id))
|
||||||
except Exception:
|
except Exception:
|
||||||
continue
|
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:
|
if spo_upc and upc and spo_upc != upc:
|
||||||
continue
|
continue
|
||||||
link_dee = f"https://www.deezer.com/album/{c_id}"
|
link_dee = f"https://www.deezer.com/album/{c_id}"
|
||||||
|
|||||||
Reference in New Issue
Block a user