Fixed spotify conversion error
This commit is contained in:
parent
4a573233a1
commit
9f90103b6d
|
@ -149,8 +149,11 @@ class SpotifyHelper:
|
||||||
else:
|
else:
|
||||||
cache = {'tracks': {}, 'albums': {}}
|
cache = {'tracks': {}, 'albums': {}}
|
||||||
if str(track_id) in cache['tracks']:
|
if str(track_id) in cache['tracks']:
|
||||||
|
dz_track = None
|
||||||
if cache['tracks'][str(track_id)]['isrc']:
|
if cache['tracks'][str(track_id)]['isrc']:
|
||||||
dz_track = dz.get_track_by_ISRC(cache['tracks'][str(track_id)]['isrc'])
|
dz_track = dz.get_track_by_ISRC(cache['tracks'][str(track_id)]['isrc'])
|
||||||
|
dz_id = dz_track['id'] if 'id' in dz_track and 'title' in dz_track else "0"
|
||||||
|
cache['tracks'][str(track_id)]['id'] = dz_id
|
||||||
return (cache['tracks'][str(track_id)]['id'], dz_track, cache['tracks'][str(track_id)]['isrc'])
|
return (cache['tracks'][str(track_id)]['id'], dz_track, cache['tracks'][str(track_id)]['isrc'])
|
||||||
singleTrack = True
|
singleTrack = True
|
||||||
spotify_track = self.sp.track(track_id)
|
spotify_track = self.sp.track(track_id)
|
||||||
|
|
Loading…
Reference in New Issue