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"],
|
||||
"name": item["name"],
|
||||
"description": item.get("description", ""),
|
||||
"tracks_total": item["tracks"]["total"],
|
||||
"tracks_total": (item.get("tracks") or {}).get("total", 0),
|
||||
"public": item["public"],
|
||||
"uri": item["uri"],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user