mirror of
https://github.com/beetbox/beets.git
synced 2026-01-03 22:42:44 +01:00
Make sure bpm values coming from echonest are stored as integers.
This commit is contained in:
parent
55cea24b7b
commit
7158f7aefc
2 changed files with 5 additions and 2 deletions
|
|
@ -360,7 +360,10 @@ class EchonestMetadataPlugin(plugins.BeetsPlugin):
|
|||
if k in ATTRIBUTES:
|
||||
field = ATTRIBUTES[k]
|
||||
log.debug(u'echonest: metadata: {0} = {1}'.format(field, v))
|
||||
item[field] = v
|
||||
if field == 'bpm':
|
||||
item[field] = int(v)
|
||||
else:
|
||||
item[field] = v
|
||||
if 'id' in values:
|
||||
enid = values['id']
|
||||
log.debug(u'echonest: metadata: {0} = {1}'.format(ID_KEY, enid))
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ def fetch_item_tempo(lib, loglevel, item, write):
|
|||
|
||||
log.log(loglevel, u'fetched tempo: %s - %s' %
|
||||
(item.artist, item.title))
|
||||
item.bpm = tempo
|
||||
item.bpm = int(tempo)
|
||||
if write:
|
||||
item.write()
|
||||
item.store()
|
||||
|
|
|
|||
Loading…
Reference in a new issue