Skip to content

Commit 5834b0a

Browse files
committed
Handle situations where tidal doesn't set the version tag
1 parent 5467603 commit 5834b0a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

tidalapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _parse_media(json_obj):
334334
'duration': json_obj['duration'],
335335
'track_num': json_obj['trackNumber'],
336336
'disc_num': json_obj['volumeNumber'],
337-
'version' : json_obj['version'],
337+
'version' : json_obj.get('version'),
338338
'popularity': json_obj['popularity'],
339339
'artist': artist,
340340
'artists': artists,

tidalapi/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ class Media(Model):
111111
duration = -1
112112
track_num = -1
113113
disc_num = 1
114+
version = None
114115
popularity = -1
115116
artist = None
116117
artists = []

0 commit comments

Comments
 (0)