beetbox / beets

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

Adding a custom attribute with a `date` type yields incorrect info in the lbirary #4652

Closed tftio closed 1 year ago

tftio commented 1 year ago

Problem

I'm trying to add a date typed flexible attribute, and something is wrong. For instance:

In config.yaml I added:

types:
  exported_at: date

I then try to add the attribute to a track:

$ beet -vv modify -W -M 'exported_at=2023-01-22' id:83761

Led to this problem:

user configuration: /Users/jfb/.config/beets/config.yaml
data directory: /Users/jfb/.config/beets
plugin paths:
lyrics: Disabling google source: no API key configured.
Sending event: pluginload
library database: /Users/jfb/.config/beets/beets-library.db
library directory: /Volumes/Media/Music/Masters
Sending event: library_opened
Modifying 1 items.
Botch - We Are the Romans - Transitions From Persona to Object (live)
  exported_at: 1969-12-31 19:00:00
Really modify? (Yes/no/select)

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
directory: /Volumes/Media/Music/Masters
library: /Users/jfb/.config/beets/beets-library.db
asciify_paths: yes
original_date: yes
artist_credit: yes

plugins:
- bpd
- edit
- inline
- convert
- discogs
- spotify
- chroma
- fetchart
- lyrics
- lastgenre
- embedart
- acousticbrainz
- fish
- web
- duplicates
- info
- missing
- yearfixer
- mbsync
- scrub
- bandcamp
- keyfinder
- ydl
- types
chroma:
    auto: no
scrub:
    auto: yes
edit:
    albumfields: album albumartist mb_albumid
    itemfields: track title artist album
    ignore_fields: id path

import:
    write: yes
    move: yes
    resume: yes
    incremental: yes
    default: apply
    quiet_fallback: skip
    duplicate_action: remove
    languages: en

match:
    strong_rec_threshold: 0.15
    ignored: missing_tracks unmatched_tracks
    ignored_media:
    - Data CD
    - DVD
    - DVD-Video
    - Blu-ray
    - HD-DVD
    - VCD
    - SVCD
    - UMD
    - VHS
    preferred:
        countries: [US, GB|UK]
        media: [Vinyl, CD, Digital Media|File]
        original_year: yes
acousticbrainz:
    auto: yes
    force: yes
    tags: []
duplicates:
    tiebreak:
        items: [bitrate]
    album: yes
    merge: yes
    move: /Users/jfb/Music/Dupes
    checksum: ''
    copy: ''
    count: no
    delete: no
    format: ''
    full: no
    keys: []
    path: no
    strict: no
    tag: ''

musicbrainz:
    user: tftio
    pass: zixfij-4guxtu-vitHuh
types:
    exported_at: date
convert:
    auto: yes
    embed: yes
    copy_album_art: yes
    never_convert_lossy_files: yes
    delete_originals: no
    copy: yes
    format: alac
    threads: 10
    formats:
        alac:
            command: ffmpeg -i $source -y -acodec alac -vcodec copy -map_metadata 0 $dest
            extension: m4a
        fdk_aac:
            command: ffmpeg -i $source -y -acodec libfdk_aac -vcodec copy -map_metadata 0 $dest
            extension: m4a
        aac:
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $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
    dest:
    pretend: no
    link: no
    hardlink: no
    id3v23: inherit
    max_bitrate: 500
    tmpdir:
    quiet: no

    paths: {}
    no_convert: ''
    album_art_maxwidth: 0
bandcamp:
    lyrics: yes
    art: yes
    source_weight: 0.5
    min_candidates: 5
    split_artist_title: no
keyfinder:
    auto: no
    bin: /Applications/KeyFinder.app/Contents/MacOS/KeyFinder
    overwrite: yes
ydl:
    download: yes
    split_files: yes
embedart:
    maxwidth: 0
    auto: yes
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
    quality: 0
lastgenre:
    whitelist: yes
    min_weight: 10
    count: 1
    fallback:
    canonical: no
    source: album
    force: yes
    auto: yes
    separator: ', '
    prefer_specific: no
    title_case: yes
missing:
    count: no
    total: no
    album: no
spotify:
    source_weight: 0.5
    mode: list
    tiebreak: popularity
    show_failures: no
    artist_field: albumartist
    album_field: album
    track_field: title
    region_filter:
    regex: []
    client_id: 4e414367a1d14c75a5c5129a627fcab8
    client_secret: REDACTED
    tokenfile: spotify_token.json
discogs:
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
    user_token: REDACTED
    separator: ', '
    index_tracks: no
bpd:
    host: ''
    port: 6600
    control_port: 6601
    password: REDACTED
    volume: 100
web:
    host: 127.0.0.1
    port: 8337
    cors: ''
    cors_supports_credentials: no
    reverse_proxy: no
    include_paths: no
    readonly: yes
pathfields: {}
item_fields: {}
album_fields: {}
yearfixer:
    auto: no
    force: no
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:

This looks very very much like an input parse failure -- something isn't reading the 2023-01-23 line as a date, and of course, 1969-12-31 is, more or less, the epoch, and thus, the zero value. Do dates need to be input as epoch_seconds or something?

tftio commented 1 year ago

I can confirm that the input for a date typed attribute is epoch seconds, and not a date string.