Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integers are not normalized #3507

adamjakab opened this issue Mar 2, 2020 · 0 comments

Integers are not normalized #3507

adamjakab opened this issue Mar 2, 2020 · 0 comments


Copy link

@adamjakab adamjakab commented Mar 2, 2020

The Curse of the Floating BPM Value


Beets currently allows the Model to set and the library to store any value for a field which is declared as types.INTEGER in the Item class. This behaviour however is not supported by MediaFile and for fields (such as bpm) which are declared as integers these values are casted to integer before being written to the audio file tags. This results in the Model remaining always dirty and hence in the impossibility to have the library fully aligned with the media files.

This issue has been reported in #762 and discussed here on the forum. I am opening a new issue because even though this issue is most evident with the bpm field in reality it affects all fields declared types.INTEGER in the Item class.

In short, for any item in the library which has a bpm value in a non-integer format:

     bpm: 119.434509277

Running this command:

$ beet write

will produce:

Madness - Full House: The Very Best of Madness - My Girl
  bpm: 119 -> 119.434509277

repeatedly. The audio file, if inspected through beet info "My Girl" will report:

    bpm: 119

Therefore library and mediafile will remain forever out of sync.


  • OS: macOS 10.13.6
  • Python version: 3.7.6
  • beets version: 1.4.9 (master)
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:

directory: /Volumes/Data/_TmpMusic_/
library: ~/.config/beets/test_library.db
asciify_paths: yes
id3v23: yes

    color: yes

- the
- inline
- info
- fromfilename
- duplicates
- convert
- zero
- acousticbrainz

    copy: no
    move: yes
    autotag: yes
    from_scratch: yes
    none_rec_action: asis
    duplicate_action: remove
        albumstatus: new

    default: '%asciify{$initial_letter}/%the{%asciify{$albumartist}}/%asciify{$album}/$track. %asciify{$title}'
    singleton: V/Various Artists/%the{%asciify{$artist}}/$track. %asciify{$title}
    comp: V/Various Artists/%the{%asciify{$artist}}/$track. %asciify{$title}

    searchlimit: 3
    initial_letter: albumartist[0].upper() if albumartist else 'U'
    auto: yes
    - month
    - day
    - encoder
    - lyrics
    - comments
    - artist_sort
    - original_month
    - original_day
    update_database: yes
    keep_fields: []
    command: ffmpeg -i $source -y -q:a 5 -f mp3 $dest
    extension: mp3
    max_bitrate: 182
    threads: 1
    auto: no
    dest: /Volumes/Data/_TmpMusic_/___converted___
    format: mp3
        mp3: ffmpeg -i $source -y -q:a 5 -f mp3 $dest
        flac: ffmpeg -i $source -y -acodec flac -q:a 5 -f mp3 $dest
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
            extension: m4a
            command: ffmpeg -i $source -y -vn -acodec alac $dest
            extension: m4a
        opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
        ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
        wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
    pretend: no
    link: no
    hardlink: no
    id3v23: inherit
    quiet: no
    embed: yes

    paths: {}
    no_convert: ''
    never_convert_lossy_files: no
    copy_album_art: no
    album_art_maxwidth: 0
    auto: no
    force: no
    tags: [bpm]
    album: no
    checksum: ''
    copy: ''
    count: no
    delete: no
    format: ''
    full: no
    keys: []
    merge: no
    move: ''
    path: no
    tiebreak: {}
    strict: no
    tag: ''
    the: yes
    a: yes
    format: '{0}, {1}'
    strip: no
    patterns: []
pathfields: {}
album_fields: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.