fix: guard against missing tracks field in list_playlists

This commit is contained in:
2026-05-25 15:32:50 +02:00
parent 29d13b6974
commit d5fa1f65c3

View File

@@ -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"],
})