beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.76k stars 1.82k forks source link

`modify` command does not accept formatted values #4543

Closed KucharczykL closed 1 year ago

KucharczykL commented 1 year ago

Problem

I wanted to use formatted modify added in https://github.com/beetbox/beets/pull/4095.

Running this command in verbose (-vv) mode:

$ beet -vv modify -f "Moonrise Kingdom" genre='$genre, Soundtrack'

Led to this problem:

user configuration: /config/config.yaml
data directory: /config
plugin paths:
lyrics: Disabling google source: no API key configured.
Sending event: pluginload
library database: /config/musiclibrary.blb
library directory: /music
Sending event: library_opened
Modifying 1 albums.
Alexandre Desplat - Moonrise Kingdom
  genre: Classical, Contemporary Classical -> $genre, Soundtrack
Really modify, move and write tags? (Yes/no/select)

As you can see, it prints the literal $genre instead of the tag's value.

Here's a link to the music files that trigger the bug (if relevant):

Setup

My configuration (output of beet config) is:

lyrics:
    bing_lang_from: []
    auto: yes
    bing_client_secret: REDACTED
    bing_lang_to:
    google_API_key: REDACTED
    google_engine_ID: REDACTED
    genius_api_key: REDACTED
    fallback:
    force: no
    local: no
    sources:
    - google
    - musixmatch
    - genius
    - tekstowo

plugins: fetchart embedart convert scrub replaygain lastgenre chroma web info duplicates mbsubmit playlist smartplaylist mbsync bpmanalyser lyrics extrafiles
directory: /music
library: /config/musiclibrary.blb
art_filename: albumart
threaded: yes
original_date: no
per_disc_numbering: no
convert:
    auto: no
    ffmpeg: /usr/bin/ffmpeg
    opts: -ab 320k -ac 2 -ar 48000
    max_bitrate: 320
    threads: 1
    dest:
    pretend: no
    link: no
    hardlink: no
    format: mp3
    id3v23: inherit
    formats:
        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
        flac: ffmpeg -i $source -y -vn -acodec flac $dest
        mp3: ffmpeg -i $source -y -vn -aq 2 $dest
        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
    tmpdir:
    quiet: no
    embed: yes

    paths: {}
    no_convert: ''
    never_convert_lossy_files: no
    copy_album_art: no
    album_art_maxwidth: 0
    delete_originals: no

paths:
    default: $albumartist/$album%aunique{}/$track - $title
    singleton: Non-Album/$artist - $title
    comp: Compilations/$album%aunique{}/$track - $title
    albumtype_soundtrack: Soundtracks/$album/$track $title

import:
    write: yes
    copy: no
    move: yes
    resume: ask
    incremental: no
    quiet_fallback: skip
    timid: no
    log: /config/beet.log
lastgenre:
    auto: yes
    source: album
    count: 5
    whitelist: /config/whitelist.txt
    min_weight: 10
    fallback:
    canonical: no
    force: yes
    separator: ', '
    prefer_specific: no
    title_case: yes
embedart:
    auto: yes
    maxwidth: 0
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
    quality: 0
fetchart:
    auto: yes
    minwidth: 0
    maxwidth: 0
    quality: 0
    max_filesize: 0
    enforce_ratio: no
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
    lastfm_key: REDACTED
    store_source: no
    high_resolution: no
    deinterlace: no
    cover_format:
replaygain:
    auto: yes
    backend: ffmpeg
    overwrite: no
    threads: 4
    parallel_on_import: no
    per_disc: no
    peak: 'true'
    targetlevel: 89
    r128: [Opus]
    r128_targetlevel: 84
scrub:
    auto: yes

replace:
    ^\.: _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|]': _
    '[\xE8-\xEB]': e
    '[\xEC-\xEF]': i
    '[\xE2-\xE6]': a
    '[\xF2-\xF6]': o
    '[\xF8]': o
    \.$: _
    \s+$: ''
web:
    host: 0.0.0.0
    port: 8337
    cors: ''
    cors_supports_credentials: no
    reverse_proxy: no
    include_paths: no
    readonly: yes
playlist:
    auto: yes
    playlist_dir: /music/Playlists
    relative_to: library
    forward_slash: no
smartplaylist:
    playlist_dir: /music/Playlists
    prefix: REDACTED
    relative_to: /music
    playlists:
    -   name: 170 BPM.m3u
        query: bpm:170
    -   name: 180 BPM.m3u
        query: bpm:180
    auto: yes
    forward_slash: no
    urlencode: no
zero:
    auto: no
    update_database: yes
    keep_fields: title, albumartist
bpmanalyser:
    auto: yes
    write: yes
    dry-run: no
    threads: 4
    force: no
    quiet: no
extrafiles:
    patterns:
        lyrics: '*.lrc'

    paths: {}
chroma:
    auto: yes
mbsubmit:
    format: $track. $title - $artist ($length)
    threshold: medium
duplicates:
    album: no
    checksum: ''
    copy: ''
    count: no
    delete: no
    format: ''
    full: no
    keys: []
    merge: no
    move: ''
    path: no
    tiebreak: {}
    strict: no
    tag: ''
jackwilsdon commented 1 year ago

I don't think formatted modify is available in 1.6.0 - you'll need to run the latest source version of beets if you want to use it (be sure to keep backups) or wait for the next release.

J4gQBqqR commented 1 year ago

I hit the same issue here. I do not want to be sounded like pushing for a release, particularly on open source projects. I wish you do not interpretate my question below as so. But is there any plan for a new release recently? Depending on the answer, I will choose to wait or choose to modify tags by hand.

Thanks.