mirror of
https://github.com/beetbox/beets.git
synced 2026-01-17 13:44:01 +01:00
Fix _handle_response reauth bug and empty str query construction
This commit is contained in:
parent
7b57b0b608
commit
f7d20090e6
1 changed files with 6 additions and 7 deletions
|
|
@ -120,7 +120,7 @@ class SpotifyPlugin(BeetsPlugin):
|
|||
'Spotify access token has expired. Reauthenticating.'
|
||||
)
|
||||
self._authenticate()
|
||||
self._handle_response(request_type, url, params=params)
|
||||
return self._handle_response(request_type, url, params=params)
|
||||
else:
|
||||
raise ui.UserError(u'Spotify API error:\n{}', response.text)
|
||||
return response.json()
|
||||
|
|
@ -374,12 +374,11 @@ class SpotifyPlugin(BeetsPlugin):
|
|||
:return: Query string to be provided to the Search API.
|
||||
:rtype: str
|
||||
"""
|
||||
query_string = keywords
|
||||
if filters is not None:
|
||||
query_string += ' ' + ' '.join(
|
||||
':'.join((k, v)) for k, v in filters.items()
|
||||
)
|
||||
return query_string
|
||||
query_components = [
|
||||
keywords,
|
||||
' '.join(':'.join((k, v)) for k, v in filters.items()),
|
||||
]
|
||||
return ' '.join([s for s in query_components if s])
|
||||
|
||||
def _search_spotify(self, query_type, filters=None, keywords=''):
|
||||
"""Query the Spotify Search API for the specified ``keywords``, applying
|
||||
|
|
|
|||
Loading…
Reference in a new issue