# Sync result properties with uniformal objects
for result in results:
if result["resultType"] == "artist":
- result["id"] = result["browseId"]
- result["name"] = result["artist"]
- del result["browseId"]
- del result["artist"]
+ if "artists" in result and len(result["artists"]) > 0:
+ result["id"] = result["artists"][0]["id"]
+ result["name"] = result["artists"][0]["name"]
+ del result["artists"]
+ else:
+ result["id"] = result["browseId"]
+ result["name"] = result["artist"]
+ del result["browseId"]
+ del result["artist"]
elif result["resultType"] == "playlist":
if "playlistId" in result:
result["id"] = result["playlistId"]