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

With original_date: yes, non-original month and day values are ignored for *album* imports #5387

Open
snejus opened this issue Aug 15, 2024 · 0 comments
Labels
bug bugs that are confirmed and actionable

Comments

@snejus
Copy link
Member

snejus commented Aug 15, 2024

Problem

When I

  • set the original_date configuration option to yes
original_date: yes

and I import an album which

  • does not have original date set
  • but has year, month and day set

Only the year field is taken into account, while month and day are set to 0.

Note: this only happens for album imports. Singletons are imported fine.

Example

See two examples of releases from Discogs and Bandcamp, both have release dates:

https://www.discogs.com/release/5999359-Andrius-Mamontovas-Geltona-%C5%BDalia-Raudona
https://furtivetrax.bandcamp.com/album/sympathies-viii

If you try importing any of these, and press C in the prompt (to see/edit the changes),
you will find that month: 0 and day: 0 are set for each of the tracks.

Then if you try to set original_date: no in your config, and re-import the same release,
you will see that the month and day fields are set correctly.

Setup

  • OS: Linux / Arch
  • Python version: Python 3.10.14
  • beets version: 2.0.0
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:

lyrics:
    bing_lang_from: []
    sources: 
    synced: yes
    auto: no
    bing_client_secret: REDACTED
    bing_lang_to:
    google_API_key: REDACTED
    google_engine_ID: REDACTED
    genius_api_key: REDACTED
    fallback:
    force: no
    local: no
    dist_thresh: 0.1
importfeeds:
    relative_to: /run/media/sarunas/music/Music
    m3u_name: hello.m3u
    formats: []
    dir:
    absolute_path: no
format: '$id: $year / $album: $artist - $title'

# --------------- Search ---------------

format_item: '$id: $year / $album: $artist - $title'
format_album: '$id: Album $album by $albumartist | $label | $catalognum | $year | $country'
directory: /run/media/sarunas/music/Music
# --------------- Main ---------------

library: ~/.music/beets/library.db
include: 
artist_credit: yes
asciify_paths: yes

aunique:
    bracket: '[]'
    keys: mb_albumid

sunique:
    keys: mb_trackid
disambig_template: '$artist | $title | $album | $year'
format_raw_length: no
fuzzy:
    threshold: 0.7
id3v23: yes
ignore:
- .*
- '*~'
- lost+found
- custom
ignore_hidden: yes

import:
    autotag: yes
    bell: no
    copy: no
    default_action: apply
    delete: yes
    detail: yes
    duplicate_action: ask
    from_scratch: no
    flat: no
    group_albums: yes
    hardlink: no
    incremental: yes
    incremental_skip_later: yes
    languages: 
    log: importlog.txt
    move: yes
    none_rec_action: skip
    link: no
    resume: yes
    pretend: no
    quiet_fallback: ask
    quiet: no
    search_ids: []
    set_fields: {}
    singletons: no
    timid: yes
    write: no
    duplicate_keys:
        album: 

match:
    distance_weights:
        album: 4.0
        album_id: 1.0
        albumdisambig: 4.5
        artist: 4.0
        catalognum: 3.0
        country: 1.0
        genre: 1.0
        label: 3.0
        media: 1.0
        mediums: 1.0
        missing_tracks: 0.0
        source: 1.0
        track_artist: 4.0
        track_index: 2.0
        track_id: 1.0
        track_length: 9.0
        track_title: 3.0
        tracks: 4.0
        unmatched_tracks: 0.5
        year: 2.0
        missing_fields: 5.0
    ignored: []
    ignored_media: []
    ignore_data_tracks: no
    ignore_video_tracks: yes
    max_rec:
        missing_tracks: none
        unmatched_tracks: medium
    medium_rec_thresh: 0.6
    preferred:
        countries: []
        media: [Vinyl, Digital Media]
        data_source: bandcamp
        original_year: yes
    rec_gap_thresh: 0.25
    required: []
    strong_rec_thresh: 0.15
    track_length_grace: 0.1
    track_length_max: 1000
    album_disambig_fields:
    - data_source
    - artist
    - name
    - media
    - year
    - month
    - day
    - catalognum
    - label
    - medium_total
    - albumtype
    - albumstatus
    - distance
    - country
    singleton_disambig_fields:
    - track
    - track_alt
    - artist
    - title
    - length
    - tracktotal
    - disctitle
    - data_source
    - media
    - catalognum
max_filename_length: 0

# --------------- Autotagger ---------------

overwrite_null:
    album:
    - artwork
    - artwork_url
    - data_source
    - mastering
    - price
    - style
    - visual_url
    track:
    - artist
    - disctitle
    - index
    - medium_index
    - title
    - track
original_date: yes
overwrite_attributes:
- data_source
- mastering
- artwork
- artwork_url
- data_source
- mastering
- price
- visual_url
- index
- times_bought
- track
- track_alt

# --------------- Paths ---------------

path_sep_replace: _
album_fields:
    multiple_artists: ''', '' in albumartist

        or ''Various'' in albumartist

        or (len(set(item.artist.split()[0] for item in items)) > 1)

        '
item_fields:
    label_or_albumartist: "aartist = (albumartist or artist).split(\", \")[0]\nif not label or label.lower() in {\"not on label\", aartist.lower()}:\n    return f'self_{aartist}'\nreturn f'{label or albumartist or artist}'\n"
    singleton_track_artist: "if label.lower() == artist.lower():\n  return f''\nreturn f'{artist}_'\n"
    track_artist: "if label.lower() == artist.lower() or albumartist == artist:\n    return f''\nreturn f'{artist}_'\n"
    album_name: "return \"_\".join((a for a in [\n  catalognum if catalognum != album else \"\",\n  (albumartist if albumartist not in {label, \"Various Artists\"} else \"\"),\n  album\n] if a.strip()))\n"
    track_identification: "if (track_alt := globals().get(\"track_alt\")) and track_alt[0].isalpha():\n  idx = f'{track_alt}'\nelif track:\n  idx = f'{str(track).zfill(2)}'\nelse:\n  return ''\n\nif disctotal > 1:\n  idx = f'{disc}_{idx}'\n\nreturn f'{idx}_'\n"
    withdrawn: return albumstatus == "Withdrawn"
paths:
    albumtype:broadcast: "sets/\n%lower{\n  %if{\n    $album,\n    $album/$track_identification$track_artist$title,\n    $track_identification$track_artist$title\n  }\n}"
    singleton: "%lower{\n  $label_or_albumartist/\n  %if{$withdrawn,_withdrawn/}\n  %if{$catalognum,${catalognum}_}\n  $singleton_track_artist$title\n}\n"
    comp: "%lower{\n  $label_or_albumartist/\n  %if{$withdrawn,_withdrawn/}\n  $album_name-%aunique{}/\n  $track_identification${artist}_$title\n}\n"
    default: "%lower{\n  $label_or_albumartist/\n  %if{$withdrawn,_withdrawn/}\n  $album_name-%aunique{}/\n  $track_identification${track_artist}$title\n}\n"

# --------------- Tagging ---------------

per_disc_numbering: yes
pluginpath: []

# --------------- Plugins ---------------

plugins:
- autobpm
- bareasc
- bandcamp
- convert
- discogs
- duplicates
- edit
- embedart
- fetchart
- importreplace
- importfeeds
- info
- inline
- lyrics
- missing
- mbcollection
- mbsync
- mpdstats
- mpdupdate
- scrub
- types
- unimported
replace:
    '[^A-z0-9]': ''
    '[\^[\]\\]': ''
sort_case_insensitive: no
statefile: stat.pickle
terminal_encoding: utf-8

# --------------- Performance ---------------

threaded: no
timeout: 5.0
types:
    rating: float
    play_count: int
    skip_count: int
    price: float
    riot: int
    hello: bool
    hidden: bool

ui:
    terminal_width: 100
    length_diff_thresh: 10.0
    color: yes

    import:
        indentation:
            match_header: 2
            match_details: 2
            match_tracklist: 4
        layout: column

# --------------- UI ---------------

verbose: 0
acoustid:
    apikey: vm82AZdvxY
autobpm:
    beat_track_kwargs:
        start_bpm: 160
    auto: yes
    overwrite: no
bandcamp:
    include_digital_only_tracks: yes
    search_max: 3
    excluded_extra_fields:
    comments_separator: '



        '
    art: yes
    genre:
        mode: psychedelic
        always_include:
        - (core|techno|trance)$
        - ^(hard.|acid)
        - psy|mental
        - free|tek
        - phonk
        capitalize: no
        maximum: 0
    field_patterns:
        times_bought:
            pattern: sponsor.*@type
            replace_expr: len(matches)
        price:
            pattern: 'price: (\S+)'
            replace_expr: float(match.group(1))
        artwork:
            pattern: (?i:\bart(work)?\b|\bcover)[^|:,.\n-]*?([-:]\ ?|by:?\ )(https:[^ ]+|([\w@](?:[^|:,.\n-]|[.]\w)+[^|:,.\n -])+)([|:,.\n -]|$)
            replace: \3
        city:
            pattern: ': Place\s+.*: ([^,\n]+), '
            replace: \1
        mastering:
            pattern: "(?i:\n  \\bmaster[\\w ]*\n  (?::[ ]?|by:?[ ])\n  (\n    (\n      (?![ ]at)\n      (\n        (\n            https:[^ ]+\n          # | [^|,.\\n -]+\n          | \\w+\n          | [.]\\b\n        )\n        | [ &@]\n      )\n    )+\n  )\n)\n"
            replace: \1
    exclude_extra_fields: []
discogs:
    user_token: REDACTED
    results_count: 3
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
    separator: ', '
    index_tracks: no
    append_style_genre: no
edit:
    ignore_fields: []
    albumfields:
    - album
    - artist
    - artist_sort
    - artwork
    - artpath
    - title
    - label
    - year
    - month
    - day
    - track
    - catalognum
    - album
    - albumartist
    - albumstatus
    - albumtype
    - albumtypes
    - catalognum
    - comments
    - comp
    - country
    - data_source
    - data_url
    - day
    - disctitle
    - genre
    - media
    - label
    - mb_albumid
    - mb_artistid
    - mediums
    - medium
    - medium_total
    - month
    - style
    - year
    itemfields:
    - album
    - albumartist
    - album_id
    - artist
    - artist_sort
    - artwork
    - title
    - label
    - year
    - month
    - day
    - track
    - catalognum
    - albumstatus
    - albumtype
    - albumtypes
    - artwork_url
    - bpm
    - comments
    - country
    - cuelist
    - data_source
    - data_url
    - disc
    - disctitle
    - disctotal
    - genre
    - genres
    - index
    - length
    - lyrics
    - mb_albumid
    - mb_artistid
    - mb_releasegroup_id
    - mb_releasetrack_id
    - mb_trackid
    - media
    - medium
    - medium_index
    - medium_total
    - mediums
    - path
    - play_count
    - skip_count
    - style
    - track_alt
    - track_id
    - tracklist
    - tracktotal
    - visual_url
embedart:
    ifempty: no
    remove_art_file: no
    auto: no
    maxwidth: 0
    compare_threshold: 0
    quality: 0
fetchart:
    lastfm_key: REDACTED
    auto: yes
    store_source: yes
    sources:
    - bandcamp
    - '*'
    - lastfm
    - filesystem
    minwidth: 0
    maxwidth: 0
    quality: 0
    max_filesize: 0
    enforce_ratio: no
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    high_resolution: no
    deinterlace: no
    cover_format:
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
lastfm:
    user: snejus
lastgenre:
    prefer_specific: yes
    title_case: no
    auto: no
    count: 3
    whitelist: no
    source: track
    min_weight: 1
mbcollection:
    auto: no
    collection: 19c7c1d7-cdb7-4855-839d-737c92a279ee
    remove: no
mpd:
    host: /run/user/60460/mpd/socket
    music_directory: /run/media/sarunas/music/Music
    port: 6600
    password: REDACTED
    strip_path: ''
    rating: yes
    rating_mix: 0.75
musicbrainz:
    enabled: no
    host: musicbrainz.org
    searchlimit: 2
    genres: yes
    user: snejus
    pass: REDACTED
    external_ids:
        discogs: yes
        bandcamp: yes
        spotify: yes
        deezer: yes
        tidal: yes
scrub:
    auto: no
unimported:
    ignore_extensions: jpg png
    ignore_subdirectories: []
ytimport:
    directory: /tmp/ytimport
    format: mp3
missing:
    count: no
    total: no
    album: no
bareasc:
    prefix: '#'
convert:
    dest:
    pretend: no
    link: no
    hardlink: no
    threads: 8
    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
    max_bitrate:
    auto: no
    auto_keep: no
    tmpdir:
    quiet: no
    embed: yes
    paths: {}
    no_convert: ''
    never_convert_lossy_files: no
    copy_album_art: no
    album_art_maxwidth: 0
    delete_originals: no
    playlist:
pathfields: {}
duplicates:
    album: no
    checksum: ''
    copy: ''
    count: no
    delete: no
    format: ''
    full: no
    keys: []
    merge: no
    move: ''
    path: no
    tiebreak: {}
    strict: no
    tag: ''
@snejus snejus added the bug bugs that are confirmed and actionable label Aug 15, 2024
@snejus snejus changed the title With original_date: yes, non-original month and day values are ignored With original_date: yes, non-original month and day values are ignored for *album* imports Aug 15, 2024
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

No branches or pull requests

1 participant