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

Closed
adamjakab opened this issue Mar 2, 2020 · 0 comments · Fixed by #3508
Closed

Integers are not normalized #3507

adamjakab opened this issue Mar 2, 2020 · 0 comments · Fixed by #3508
Labels
bug bugs that are confirmed and actionable

Comments

@adamjakab
Copy link
Contributor

The Curse of the Floating BPM Value

Problem

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.

Setup

  • 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

ui:
    color: yes

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

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

paths:
    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}

musicbrainz:
    searchlimit: 3
item_fields:
    initial_letter: albumartist[0].upper() if albumartist else 'U'
zero:
    auto: yes
    fields:
    - month
    - day
    - encoder
    - lyrics
    - comments
    - artist_sort
    - original_month
    - original_day
    update_database: yes
    keep_fields: []
convert:
    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
    formats:
        mp3: ffmpeg -i $source -y -q:a 5 -f mp3 $dest
        flac: ffmpeg -i $source -y -acodec flac -q:a 5 -f mp3 $dest
        aac:
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
            extension: m4a
        alac:
            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
    tmpdir:
    quiet: no
    embed: yes

    paths: {}
    no_convert: ''
    never_convert_lossy_files: no
    copy_album_art: no
    album_art_maxwidth: 0
acousticbrainz:
    auto: no
    force: no
    tags: [bpm]
duplicates:
    album: no
    checksum: ''
    copy: ''
    count: no
    delete: no
    format: ''
    full: no
    keys: []
    merge: no
    move: ''
    path: no
    tiebreak: {}
    strict: no
    tag: ''
the:
    the: yes
    a: yes
    format: '{0}, {1}'
    strip: no
    patterns: []
pathfields: {}
album_fields: {}
@adamjakab adamjakab mentioned this issue Mar 2, 2020
@sampsyo sampsyo added the bug bugs that are confirmed and actionable label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants