mirror of
https://github.com/beetbox/beets.git
synced 2026-01-16 05:02:28 +01:00
fix #562: fail on empty code and handle analyze exceptions
This commit is contained in:
parent
057ff66ad6
commit
bf7e04af0f
1 changed files with 5 additions and 1 deletions
|
|
@ -126,6 +126,10 @@ class EchonestMetadataPlugin(plugins.BeetsPlugin):
|
|||
except (pyechonest.util.EchoNestIOError, socket.error) as e:
|
||||
log.warn(u'echonest: IO error: {0}'.format(e))
|
||||
time.sleep(RETRY_INTERVAL)
|
||||
except Exception as e:
|
||||
# there was an error analyzing the track, status: error
|
||||
log.debug(u'echonest: {0}'.format(e))
|
||||
return None
|
||||
else:
|
||||
break
|
||||
else:
|
||||
|
|
@ -228,7 +232,7 @@ class EchonestMetadataPlugin(plugins.BeetsPlugin):
|
|||
log.debug(u'echonest: codegen failed: {0}'.format(e))
|
||||
return
|
||||
|
||||
if not res or 'code' not in res[0]:
|
||||
if not res or 'code' not in res[0] or not res[0]['code']:
|
||||
log.debug(u'echonest: no fingerprint returned')
|
||||
return
|
||||
code = res[0]['code']
|
||||
|
|
|
|||
Loading…
Reference in a new issue