Merge code cleanup

This commit is contained in:
RemixDev 2021-08-11 12:25:11 +02:00
parent caee30f37c
commit a705794a91
No known key found for this signature in database
GPG Key ID: B33962B465BDB51C
1 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ class Spotify(Plugin):
cache['tracks'][link_id] = cachedTrack cache['tracks'][link_id] = cachedTrack
self.saveCache(cache) self.saveCache(cache)
if 'id' in cachedTrack and cachedTrack['id'] != "0": if cachedTrack.get('id', "0") != "0":
return generateTrackItem(dz, cachedTrack['id'], bitrate) return generateTrackItem(dz, cachedTrack['id'], bitrate)
raise TrackNotOnDeezer(f"https://open.spotify.com/track/{link_id}") raise TrackNotOnDeezer(f"https://open.spotify.com/track/{link_id}")
@ -213,7 +213,7 @@ class Spotify(Plugin):
cache['tracks'][track['id']] = cachedTrack cache['tracks'][track['id']] = cachedTrack
self.saveCache(cache) self.saveCache(cache)
if 'id' in cachedTrack and cachedTrack['id'] != "0": if cachedTrack.get('id', "0") != "0":
trackAPI = dz.api.get_track(cachedTrack['id']) trackAPI = dz.api.get_track(cachedTrack['id'])
deezerTrack = None deezerTrack = None