fix: guard against missing tracks field in list_playlists
This commit is contained in:
@@ -63,7 +63,7 @@ def list_playlists() -> list[dict]:
|
|||||||
"id": item["id"],
|
"id": item["id"],
|
||||||
"name": item["name"],
|
"name": item["name"],
|
||||||
"description": item.get("description", ""),
|
"description": item.get("description", ""),
|
||||||
"tracks_total": item["tracks"]["total"],
|
"tracks_total": (item.get("tracks") or {}).get("total", 0),
|
||||||
"public": item["public"],
|
"public": item["public"],
|
||||||
"uri": item["uri"],
|
"uri": item["uri"],
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user