mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Simplify loop and update changelog entry
This commit is contained in:
parent
b9da57481f
commit
f79fd64aeb
2 changed files with 10 additions and 11 deletions
|
|
@ -196,7 +196,8 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin):
|
|||
raise SpotifyAPIError(f'API Error: {e.response.status_code}\n'
|
||||
f'URL: {url}\nparams: {params}')
|
||||
elif e.response.status_code == 429:
|
||||
if retry_count < max_retries:
|
||||
if retry_count >= max_retries:
|
||||
raise SpotifyAPIError('Maximum retries reached.')
|
||||
seconds = response.headers.get('Retry-After',
|
||||
DEFAULT_WAITING_TIME)
|
||||
self._log.debug(f'Too many API requests. Retrying after '
|
||||
|
|
@ -205,8 +206,6 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin):
|
|||
return self._handle_response(request_type, url,
|
||||
params=params,
|
||||
retry_count=retry_count + 1)
|
||||
else:
|
||||
raise SpotifyAPIError('Maximum retries reached.')
|
||||
elif e.response.status_code == 503:
|
||||
self._log.error('Service Unavailable.')
|
||||
raise SpotifyAPIError('Service Unavailable.')
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ New features:
|
|||
|
||||
Bug fixes:
|
||||
|
||||
* Fix retry-logic for Spotify plugin.
|
||||
* :doc:`/plugins/spotify`: Add a limit of 3 retries, instead of retrying endlessly when the API is not available.
|
||||
* Fix a crash when the Spotify API timeouts or does not return a `Retry-After` interval.
|
||||
:bug:`4942`
|
||||
* :doc:`/plugins/scrub`: Fixed the import behavior where scrubbed database tags
|
||||
|
|
|
|||
Loading…
Reference in a new issue