mirror of
https://github.com/beetbox/beets.git
synced 2025-12-31 13:02:47 +01:00
Handle Deezer API errors
This commit is contained in:
parent
39fd14cec7
commit
4cf2c6d3a1
1 changed files with 8 additions and 0 deletions
|
|
@ -82,6 +82,10 @@ class DeezerPlugin(MetadataSourcePlugin, BeetsPlugin):
|
|||
except requests.exceptions as e:
|
||||
self._log.debug("Error fetching album {}\n Error: {}", deezer_id, e)
|
||||
return None
|
||||
else:
|
||||
if 'error' in album_data:
|
||||
self._log.debug("Deezer API error: {}", album_data['error']['message'])
|
||||
return None
|
||||
contributors = album_data.get("contributors")
|
||||
if contributors is not None:
|
||||
artist, artist_id = self.get_artist(contributors)
|
||||
|
|
@ -223,6 +227,10 @@ class DeezerPlugin(MetadataSourcePlugin, BeetsPlugin):
|
|||
e,
|
||||
)
|
||||
return None
|
||||
else:
|
||||
if 'error' in album_tracks_data:
|
||||
self._log.debug("Deezer API error: {}", album_tracks_data['error']['message'])
|
||||
return None
|
||||
medium_total = 0
|
||||
for i, track_data in enumerate(album_tracks_data, start=1):
|
||||
if track_data["disk_number"] == track.medium:
|
||||
|
|
|
|||
Loading…
Reference in a new issue