beetbox / beets

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

Bug when moving files to path containing $added field? #4185

Closed soulstyle closed 2 years ago

soulstyle commented 2 years ago

I'm having issues with the following path:

genre:house: House/%time{$added,%Y}/%time{$added,%m}/$track $title

When modifying the added timestamp of a file it is not moved to the correct location. Running beet mv does not move it either.

It's like paths with %time{$added, %Y} only works on the first import.

Problem

Steps that leads to the problem:

  1. Importing a file (with the genre House for the path to apply)
    • File is moved to the expected location on import as seen in the screenshot below.
  2. Modify the added timestamp
    • File is not moved to expected location
  3. Run beet -vv mv
    • Moving 0 items (1 already in place)

You can see all the steps here except the modify command, but, you can see that the added timestamp is changed compared with the path in the first beet list command.

https://share.getcloudapp.com/5zu9Ex4p

Setup

Beets is installed using the linuxserver/beets docker container.

My configuration (output of beet config) is:

plugins: fromfilename discogs bandcamp spotify fetchart embedart edit rbsync rbexport zero web importadded info playlist smartplaylist ftintitle metasync chroma duplicates
directory: /music
library: /config/musiclibrary.blb
art_filename: '%asciify{${album}}_cover'
threaded: yes
original_date: yes
pluginpath: [/config/beetsplug]

import:
    copy: yes
    write: yes
    log: beets-import-log.txt
    resume: ask
    incremental: yes
    bell: yes
    set_fields:
        sorted: 'yes'

paths:
    default: Other/%time{$added,%Y}/%time{$added,%m}/$track $title
    genre:house: House/%time{$added,%Y}/%time{$added,%m}/$track $title
    genre:hip hop: Hip-Hop/%time{$added,%Y}/%time{$added,%m}/$track $title
    genre:rap: Hip-Hop/%time{$added,%Y}/%time{$added,%m}/$track $title
    genre:mixtape: Mixtapes/%time{$added,%Y}/%time{$added,%m}/$track $title
    comp: Other/%time{$added,%Y}/%time{$added,%m}/$track $title
metasync:
    source: itunes
    itunes:
        library: /config/AppleMusicLibrary.xml
rbsync:
    library: /config/rekordbox.xml
rbexport:
    export_file_path: /Users/soulstream/Music/BeetsTest/
discogs:
    source_weight: 0.0
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    user_token: REDACTED
    separator: ', '
    index_tracks: no
bandcamp:
    lyrics: no
    art: yes
    split_artist_title: no
    source_weight: 0.0
    preferred_media: Digital Media
    include_digital_only_tracks: yes
    search_max: 10
    exclude_extra_fields: []
    genre:
        capitalize: no
        maximum: 0
        mode: progressive
        always_include: []
    comments_separator: '

        ---

        '
spotify:
    source_weight: 0.7
    mode: list
    tiebreak: popularity
    show_failures: no
    artist_field: albumartist
    album_field: album
    track_field: title
    region_filter:
    regex: []
    client_id: REDACTED
    client_secret: REDACTED
    tokenfile: spotify_token.json
edit:
    itemfields: track title artist album albumartist year genre added label comments sorted
    albumfields: album albumartist genre year added comments sorted
    ignore_fields: id path
zero:
    fields: comments lyricist encoder
    comments: ['[TraxCrate.com]', TraxCrate.com, ripped by]
    update_database: yes
    auto: yes
    keep_fields: []
web:
    host: 127.0.0.1
    port: 8337
    include_paths: no
    cors: ''
    cors_supports_credentials: no
    reverse_proxy: no
    readonly: yes
importadded:
    preserve_mtimes: yes
    preserve_write_mtimes: yes
ftintitle:
    auto: yes
    drop: no
    format: feat. {0}
playlist:
    auto: yes
    playlist_dir: /playlists
    relative_to: library
    forward_slash: no
smartplaylist:
    relative_to: /music
    playlist_dir: /playlists
    playlists:
    -   name: all.m3u
        query: ''
    -   name: mixtapes.m3u
        query: genre:mixtape
    auto: yes
    forward_slash: no
    prefix: REDACTED
    urlencode: no
embedart:
    maxwidth: 0
    auto: yes
    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
duplicates:
    album: no
    checksum: ''
    copy: ''
    count: no
    delete: no
    format: ''
    full: no
    keys: []
    merge: no
    move: ''
    path: no
    tiebreak: {}
    strict: no
    tag: ''
chroma:
    auto: yes
sampsyo commented 2 years ago

Hmm; can you please include the beet modify command you're using? added is an album-level field, so you'll want to be sure you're using the -a flag.

soulstyle commented 2 years ago

Oh, I see. Overlooked that. Thanks!

How does that work for files that are missing the album id3 tag and are added to the library with -A parameter?

sampsyo commented 2 years ago

They still get album entries in the database, so this all still works. (As long as you don't import them as singletons, with the -s flag. Those get imported as individual tracks.)

soulstyle commented 2 years ago

Thanks 👍

Beets is awesome btw!

Working on migrating my 200GB+ iTunes library into beets including itunes ratings, added date and smart playlists. It's slowly coming together. Also looking into connecting beets with pioneers rekordbox somehow - I built a test beetsplug a while back that exports a rekordbox compatible XML file from your beets query along with playlists.