mirror of
https://github.com/beetbox/beets.git
synced 2025-12-22 08:34:23 +01:00
Prevent scientific notation
This commit is contained in:
parent
4d55e6dfbb
commit
a60935ed1c
1 changed files with 8 additions and 1 deletions
|
|
@ -17,9 +17,10 @@
|
|||
"""
|
||||
from __future__ import division, absolute_import, print_function
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
import requests
|
||||
|
||||
from collections import defaultdict
|
||||
from beets import plugins, ui
|
||||
|
||||
ACOUSTIC_BASE = "https://acousticbrainz.org/"
|
||||
|
|
@ -101,6 +102,10 @@ ABSCHEME = {
|
|||
|
||||
}
|
||||
}
|
||||
FLOAT_FIELDS = ['danceable', 'mood_acoustic', 'mood_aggressive',
|
||||
'mood_electronic', 'mood_happy', 'mood_party', 'mood_relaxed',
|
||||
'mood_sad', 'tonal', 'average_loudness', 'chords_changes_rate',
|
||||
'chords_number_rate', 'key_strength']
|
||||
|
||||
|
||||
class AcousticPlugin(plugins.BeetsPlugin):
|
||||
|
|
@ -186,6 +191,8 @@ class AcousticPlugin(plugins.BeetsPlugin):
|
|||
if data:
|
||||
for attr, val in self._map_data_to_scheme(data, ABSCHEME):
|
||||
if not tags or attr in tags:
|
||||
if attr in FLOAT_FIELDS:
|
||||
val = '%f' % val
|
||||
self._log.debug(u'attribute {} of {} set to {}',
|
||||
attr,
|
||||
item,
|
||||
|
|
|
|||
Loading…
Reference in a new issue