corrige nombre de playlists curadas: elimina fields= en llamada a API
El parámetro fields="name,description,images" causaba error en playlists curadas de Spotify (ej. "This Is ..."), haciendo que el nombre cayera al fallback con el spotify_id. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,9 +45,9 @@ def _extract_spotify_item(value: str) -> tuple[str, str] | None:
|
|||||||
|
|
||||||
def _fetch_metadata(sp, spotify_id: str, spotify_type: str) -> dict:
|
def _fetch_metadata(sp, spotify_id: str, spotify_type: str) -> dict:
|
||||||
if spotify_type == "playlist":
|
if spotify_type == "playlist":
|
||||||
data = sp.playlist(spotify_id, fields="name,description,images")
|
data = sp.playlist(spotify_id)
|
||||||
return {
|
return {
|
||||||
"name": data["name"],
|
"name": data.get("name") or spotify_id,
|
||||||
"description": data.get("description") or "",
|
"description": data.get("description") or "",
|
||||||
"image_url": data["images"][0]["url"] if data.get("images") else "",
|
"image_url": data["images"][0]["url"] if data.get("images") else "",
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user