Skip to content

Commit fafad38

Browse files
committed
fix(playlist): More robust handling of the passed objects.
Apparently we can't always assume that the JSON object passed to `parse_playlist` always contains a `data` envelope. Closes: #349
1 parent 07a3353 commit fafad38

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tidalapi/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def parse_v2_mix(self, obj: JsonObj) -> mix.Mix:
361361
def parse_playlist(self, obj: JsonObj) -> playlist.Playlist:
362362
"""Parse a playlist from the given response."""
363363
# Note: When parsing playlists from v2 response, "data" field must be parsed
364-
return self.playlist().parse(obj["data"])
364+
return self.playlist().parse(obj.get("data", obj))
365365

366366
def parse_folder(self, obj: JsonObj) -> playlist.Folder:
367367
"""Parse an album from the given response."""

0 commit comments

Comments
 (0)