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

scrub: The auto option should be a no-op when import.write is disabled #4326

Closed
fracai opened this issue Mar 26, 2022 · 2 comments · Fixed by #4900
Closed

scrub: The auto option should be a no-op when import.write is disabled #4326

fracai opened this issue Mar 26, 2022 · 2 comments · Fixed by #4900
Labels
bug bugs that are confirmed and actionable

Comments

@fracai
Copy link
Contributor

fracai commented Mar 26, 2022

Problem

I was importing new tracks with import.write disabled and seeing all tracks populated with new tags. With help from the forum, I was able to determine that with scrub.auto enabled and import.write disabled, the scrub plugin removes tags and rewrites them from the database.
The scrub documentation indicates that scrubbing on import is only active if import.write is also enabled.

When importing new files (with import.write turned on) or modifying files’ tags with the beet modify command, beets will first strip all types of tags entirely and then write the database-tracked metadata to the file.

I'd think a resolution could be:

  • Update the documentation to indicate scrub doesn't read the import.write setting.
  • Or scrub should read that setting.
  • Or, even better, have a separate scrub configuration that disables restoring tags after the scrub.

Setup

My configuration (output of beet config) is:

lyrics:
    bing_lang_from: []
    auto: no
    fallback: ''
    sources: genius
    bing_client_secret: REDACTED
    bing_lang_to:
    google_API_key: REDACTED
    google_engine_ID: REDACTED
    genius_api_key: REDACTED
    force: no
    local: no

plugins:
- fetchart
- embedart
- convert
- scrub
- replaygain
- lyrics
- lastgenre
- the
- inline
- chroma
- web
- permissions
directory: /music
library: /config/musiclibrary.blb
art_filename: _cover
threaded: yes
original_date: yes
per_disc_numbering: yes
chroma:
    auto: yes
embedart:
    auto: no
    maxwidth: 0
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
    quality: 0
convert:
    auto: no
    dest: /converted
    format: aac
    formats:
        aac:
            command: ffmpeg -i $source -c:a aac -vbr 4 $dest
            extension: m4a
        mp3:
            command: /config/gapless-mp3.sh $source $dest
            extension: mp3
        alac:
            command: ffmpeg -i $source -y -vn -acodec alac $dest
            extension: m4a
        flac: ffmpeg -i $source -y -vn -acodec flac $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
    pretend: no
    link: no
    hardlink: no
    threads: 8
    id3v23: inherit
    max_bitrate: 500
    tmpdir:
    quiet: no
    embed: yes

    paths: {}
    no_convert: ''
    never_convert_lossy_files: no
    copy_album_art: no
    album_art_maxwidth: 0
    delete_originals: no
item_fields:
    disc_and_track: u'%02i.%02i' % (disc, track) if disctotal > 1 else u'%02i' % (track)
the:
    a: no
    the: yes
    format: '{0}, {1}'
    strip: no
    patterns: []

paths:
    default: '%the{$albumartist}/$original_year - $album%aunique{}/$disc_and_track $title'
    singleton: '%the{$albumartist}/_singles/$original_year - $title'
    comp: _Compilations/$original_year - $album%aunique{}/$disc_and_track $title
    albumtype_soundtrack: _Soundtracks/$original_year - $album%aunique{}/$disc_and_track $title
permissions:
    file: 664
    dir: 775

import:
    write: no
    copy: no
    move: yes
    resume: ask
    incremental: no
    quiet_fallback: skip
    timid: no
    log: /config/beet.log
lastgenre:
    auto: yes
    source: album
    whitelist: yes
    min_weight: 10
    count: 1
    fallback:
    canonical: no
    force: yes
    separator: ', '
    prefer_specific: no
    title_case: yes
fetchart:
    auto: yes
    store_source: yes
    minwidth: 600
    sources:
    - filesystem
    - coverart
    - itunes
    - albumart
    - amazon
    maxwidth: 0
    quality: 0
    max_filesize: 0
    enforce_ratio: no
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
    lastfm_key: REDACTED
    high_resolution: no
    deinterlace: no
    cover_format:
replaygain:
    auto: yes
    backend: ffmpeg
    overwrite: no
    threads: 8
    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
pathfields: {}
album_fields: {}
@sampsyo sampsyo added the bug bugs that are confirmed and actionable label Mar 27, 2022
@sampsyo sampsyo changed the title The scrub plugin rewrites tags even if import.write is disabled scrub: The auto option should be a no-op when import.write is disabled Mar 27, 2022
@sampsyo
Copy link
Member

sampsyo commented Mar 27, 2022

Thank you for the detailed report! It does seem like this is a (fairly obvious in retrospect!) bug. Since the documentation says one thing and the plugin does the other, I think we should follow the docs. (It seems like the plugin is missing any sort of check whatsoever.)

@RollingStar
Copy link
Collaborator

for reference:

def import_task_files(self, session, task):

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.

3 participants