mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 12:02:41 +01:00
Fixed PaddedFloat-type and set precision to 8
This commit is contained in:
parent
07b617b307
commit
7240a826bc
2 changed files with 16 additions and 16 deletions
|
|
@ -183,7 +183,7 @@ class Float(Type):
|
|||
return u'{0:.1f}'.format(value or 0.0)
|
||||
|
||||
|
||||
class PaddedFloat(Integer):
|
||||
class PaddedFloat(Float):
|
||||
"""A float field that is formatted with a given number of digits,
|
||||
padded with zeroes.
|
||||
"""
|
||||
|
|
@ -191,7 +191,7 @@ class PaddedFloat(Integer):
|
|||
self.digits = digits
|
||||
|
||||
def format(self, value):
|
||||
return u'{0:0{1}d}'.format(value or 0, self.digits)
|
||||
return u'{0:.{1}f}'.format(value or 0, self.digits)
|
||||
|
||||
|
||||
class NullFloat(Float):
|
||||
|
|
|
|||
|
|
@ -107,25 +107,25 @@ ABSCHEME = {
|
|||
|
||||
class AcousticPlugin(plugins.BeetsPlugin):
|
||||
item_types = {
|
||||
'average_loudness': types.PaddedFloat(6),
|
||||
'chords_changes_rate': types.PaddedFloat(6),
|
||||
'average_loudness': types.PaddedFloat(8),
|
||||
'chords_changes_rate': types.PaddedFloat(8),
|
||||
'chords_key': types.STRING,
|
||||
'chords_number_rate': types.PaddedFloat(6),
|
||||
'chords_number_rate': types.PaddedFloat(8),
|
||||
'chords_scale': types.STRING,
|
||||
'danceable': types.PaddedFloat(6),
|
||||
'danceable': types.PaddedFloat(8),
|
||||
'gender': types.STRING,
|
||||
'genre_rosamerica': types.STRING,
|
||||
'initial_key': types.STRING,
|
||||
'key_strength': types.PaddedFloat(6),
|
||||
'mood_acoustic': types.PaddedFloat(6),
|
||||
'mood_aggressive': types.PaddedFloat(6),
|
||||
'mood_electronic': types.PaddedFloat(6),
|
||||
'mood_happy': types.PaddedFloat(6),
|
||||
'mood_party': types.PaddedFloat(6),
|
||||
'mood_relaxed': types.PaddedFloat(6),
|
||||
'mood_sad': types.PaddedFloat(6),
|
||||
'rhythm': types.PaddedFloat(6),
|
||||
'tonal': types.PaddedFloat(6),
|
||||
'key_strength': types.PaddedFloat(8),
|
||||
'mood_acoustic': types.PaddedFloat(8),
|
||||
'mood_aggressive': types.PaddedFloat(8),
|
||||
'mood_electronic': types.PaddedFloat(8),
|
||||
'mood_happy': types.PaddedFloat(8),
|
||||
'mood_party': types.PaddedFloat(8),
|
||||
'mood_relaxed': types.PaddedFloat(8),
|
||||
'mood_sad': types.PaddedFloat(8),
|
||||
'rhythm': types.PaddedFloat(8),
|
||||
'tonal': types.PaddedFloat(8),
|
||||
'voice_instrumental': types.STRING,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue