mirror of
https://github.com/beetbox/beets.git
synced 2026-01-01 05:23:05 +01:00
fetchart: Automatically disable google backend if no API key is set
This commit is contained in:
parent
b73cfb9f8d
commit
deadc4d049
1 changed files with 3 additions and 3 deletions
|
|
@ -169,9 +169,6 @@ class GoogleImages(ArtSource):
|
|||
engine_id = config['fetchart']['google_engine_ID'].get()
|
||||
self._log.debug('API Key: ' + api_key)
|
||||
self._log.debug('Engine ID: ' + engine_id)
|
||||
if not api_key:
|
||||
self._log.debug(u'google api key not set')
|
||||
return
|
||||
if not (album.albumartist and album.album):
|
||||
return
|
||||
search_string = (album.albumartist + ',' + album.album).encode('utf-8')
|
||||
|
|
@ -446,6 +443,9 @@ class FetchArtPlugin(plugins.BeetsPlugin, RequestMixin):
|
|||
available_sources = list(SOURCES_ALL)
|
||||
if not HAVE_ITUNES and u'itunes' in available_sources:
|
||||
available_sources.remove(u'itunes')
|
||||
if not self.config['google_API_key'].get() and \
|
||||
u'google' in available_sources:
|
||||
available_sources.remove(u'google')
|
||||
sources_name = plugins.sanitize_choices(
|
||||
self.config['sources'].as_str_seq(), available_sources)
|
||||
self.sources = [ART_SOURCES[s](self._log) for s in sources_name]
|
||||
|
|
|
|||
Loading…
Reference in a new issue