Address comments

This commit is contained in:
Alok Saboo 2022-06-29 19:54:12 -04:00
parent 9bde98c440
commit 54af411b62
2 changed files with 8 additions and 8 deletions

View file

@ -189,9 +189,6 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin):
seconds.', seconds)
time.sleep(int(seconds) + 1)
return self._handle_response(request_type, url, params=params)
elif 'analysis not found' in response.text:
self._log.debug('No audio analysis found')
return None
else:
raise ui.UserError(
'{} API error:\n{}\nURL:\n{}\nparams:\n{}'.format(
@ -645,7 +642,12 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin):
def track_audio_features(self, track_id=None):
"""Fetch track audio features by its Spotify ID."""
track_data = self._handle_response(
requests.get, self.audio_features_url + track_id
)
try:
track_data = self._handle_response(
requests.get, self.audio_features_url + \
track_id)
track_data.raise_for_status()
except requests.exceptions.RequestException as e:
self._log.debug('Audio feature update failed: {0}', str(e))
track_data = None
return track_data

View file

@ -32,8 +32,6 @@ New features:
Bug fixes:
* Fix Spotify API error when tracks do not have audio-features.
:bug:`4385`
* We now respect the Spotify API's rate limiting, which avoids crashing when the API reports code 429 (too many requests).
:bug:`4370`
* Fix implicit paths OR queries (e.g. ``beet list /path/ , /other-path/``)