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

include option to have set_field add fields to track vs album. #2800

Closed
ghost opened this issue Jan 29, 2018 · 1 comment
Closed

include option to have set_field add fields to track vs album. #2800

ghost opened this issue Jan 29, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 29, 2018

Problem

This is more of a feature request. I would like set_fields option to be able to add things at the track level, rather than just the album level. Without it, I have to run a second modify command after import to query for tracks where the field is NOT set to yes or no, and set it to yes if so.

Running this command in verbose (-vv) mode:

$ beet -vv import "some_dir"

Led to this problem:

(There isn't a problem in the output).

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

Setup

  • OS: Gentoo Linux
  • Python version: 3.5.4
  • beets version: 1.4.6
  • Turning off plugins made problem go away (yes/no): n/a

My configuration (output of beet config) is:

path_sep_replace: _
ignore:
- .AppleDouble
- .*
- '*~'
- System Volume Information
ftintitle:
    auto: yes
    drop: no
    format: (ft. {0})
fetchart:
    sources: coverart itunes google amazon wikipedia albumart filesystem
    google_key: REDACTED
    cautious: yes
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    maxwidth: 0
    fanarttv_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    auto: yes
    store_source: no
    minwidth: 0
    enforce_ratio: no

replace:
    '''': ''
    '[\\/]': _
    ^\.: _
    '[\x00-\x1f]': _
    '[<>"\?\*\|]': ''
    \.$: _
    \s+$: ''
    ^\s+: ''
    ^-: _
    ':': ','
embedart:
    auto: yes
    maxwidth: 1024
    remove_art_file: yes
    ifempty: no
    compare_threshold: 0

clutter:
- Thumbs.db
- .DS_Store
- '*.log'
- '*.txt'
- '*.cue'
- '*.pls'
- '*.m3u'
- '*.sfv'
- '*.nfo'

ui:
    terminal_width: 120
    color: yes
    colors:
        text_success: green
        text_warning: yellow
        text_error: red
        text_highlight: purple
        text_highlight_minor: lightgray
        action_default: cyan
        action: blue
art_filename: folder
ignore_hidden: no
library: ~/.config/beets/library.db
directory: ~/Music/vault
album_fields:
    multidisc: "disc_numbers = {}\nfor item in items:\n    disc_numbers[item.disc] = None\nif len(disc_numbers) > 1:\n    return 1\nelse:\n    return 0\n"
original_date: no
asciify_paths: yes
modify:
    move: yes
time_format: '%Y-%m-%d %H:%M:%S'
acousticbrainz:
    auto: yes
    force: yes
va_name: Various Artists
convert:
    auto: no
    embed: yes
    never_convert_lossy_files: yes
    dest:

    paths: {}
    format: oggflac
    formats:
        oggflac:
            command: ffmpeg -i $source -y -f flac -c:a flac -compression_level 12 -vn $dest
            extension: flac
        wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
        aac:
            extension: m4a
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $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
        alac:
            extension: m4a
            command: ffmpeg -i $source -y -vn -acodec alac $dest
        flac: ffmpeg -i $source -y -vn -acodec flac $dest
    tmpdir:
    pretend: no
    max_bitrate: 500
    no_convert: ''
    threads: 4
    copy_album_art: no
    album_art_maxwidth: 0
    quiet: no
threaded: yes
per_disc_numbering: yes
the:
    a: yes
    the: yes
    patterns: [^die]
    strip: no
    format: '{0}, {1}'
update:
    move: yes
lastgenre:
    auto: yes
    canonical: no
    count: 1
    separator: ', '
    fallback:
    source: album
    min_weight: 10
    force: yes
    whitelist: yes
    prefer_specific: no

paths:
    albumtype:soundtrack: $active_path/Soundtracks/[$original_year] $album/%if{$multidisc,cd$disc_fallback - }$track - %the{$artist} - $title
    comp:true: $active_path/Compilations/[$original_year] $album/%if{$multidisc,cd$disc_fallback - }$track - %the{$artist} - $title
    singleton:true: $active_path/%the{$artist_fallback}/$title
    default: $active_path/%the{$artist_fallback}/[$year_fallback] $album%if{$not_album, ($albumtype)}/%if{$multidisc,cd$disc_fallback - }$track - $title

import:
    write: yes
    copy: yes
    move: no
    languages: [en]
    autotag: yes
    timid: no
    bell: no
    from_scratch: yes
    incremental: yes
    set_fields:
        active: yes

plugins: info inline missing convert ftintitle zero fetchart the lastgenre mbsync embedart
scrub:
    auto: yes
zero:
    fields: comments
    auto: yes
    update_database: no
    keep_fields: []
item_fields:
    artist_fallback: albumartist if albumartist else artist
    year_fallback: original_year if original_year else year
    disc_fallback: str(disc).lstrip('0')
    not_album: "if albumtype!='album':\n    return 1\nelse:\n    return 0\n"
    active_path: "if 'active' not in globals():\n    return 'Active'\nelse:\n    if active=='yes':\n        return 'Active'\n    if active=='no':\n        return 'Inactive'\n"
terminal_encoding: utf8
missing:
    total: no
    count: no
    album: no
pathfields: {}
@sampsyo
Copy link
Member

sampsyo commented Jan 29, 2018

Hi! We've just been discussing exactly this issue in #2797. I agree that this is probably the right resolution to the problem described there, as well as the more general issue you've brought up in this context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant