beetbox / beets

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

absubmit: Actually implement `auto` for analysis on import #2861

Open lhupitr opened 6 years ago

lhupitr commented 6 years ago

Problem

When importing absubmit isn't triggered even though it is set to auto in my config file.

Running this command in verbose (-vv) mode:

$ beet -vv import /net/nfs4/server/mediacentre/Downloads/seeding/Music/.store/Amy\ Allison\ -\ 2003\ -\ No\ Frills\ Friend

Led to this problem:

There is no output about absubmit, acousticbrainz (which is listed after absubmit in plugins) functions but pulls no data for unrecognised tracks:

acousticbrainz: getting data for: Amy Allison - No Frills Friend - What's the Deal?
acousticbrainz: fetching URL: https://acousticbrainz.org/45c3643b-2102-4daa-b15f-1d1ce7089e8b/low-level
acousticbrainz: recording ID 45c3643b-2102-4daa-b15f-1d1ce7089e8b not found
acousticbrainz: getting data for: Amy Allison - No Frills Friend - No Frills Friend
acousticbrainz: fetching URL: https://acousticbrainz.org/13c7456c-270b-49a6-9fda-7cc26c97f7ed/low-level
acousticbrainz: recording ID 13c7456c-270b-49a6-9fda-7cc26c97f7ed not found

After import, running beet absubmit on the album works, then running beet acousticbrainz retrieves the data.

Setup

My configuration (output of beet config) is:

llyrics:
    bing_lang_from: []
    auto: yes
    google_API_key: REDACTED
    sources: google
    bing_client_secret: REDACTED
    bing_lang_to:
    google_engine_ID: REDACTED
    genius_api_key: REDACTED
    fallback:
    force: no
    local: no
importfeeds:
    relative_to: !!binary |
        L25ldC9uZnM0L3NlcnZlci9tZWRpYWNlbnRyZS9NdXNpYy9MaWJyYXJ5
    formats: m3u
    dir: /media/mediacentre/Mediacentre/Music/Playlists/
    m3u_name: imported.m3u
    absolute_path: no
directory: /net/nfs4/server/mediacentre/Music/Library
library: /net/nfs4/server/mediacentre/Music/Catalogs/beets.blb

plugins: inline edit fromfilename zero rewrite fuzzy info missing random types replaygain smartplaylist duplicates badfiles play chroma absubmit acousticbrainz mbsync mbsubmit lastimport embedart fetchart thumbnails importfeeds lyrics wlg popularity
pluginpath: ~/projects/whatlastgenre/plugin/beets/beetsplug
per_disc_numbering: yes
threaded: no

import:
    write: yes
    copy: yes
    hardlink: no
    autotag: yes
    incremental: no
    resume: yes
    quiet_fallback: skip
    none_rec_action: ask
    timid: yes
    log: ~/.config/beets/beetslog.txt
    detail: yes
    bell: yes
    from_scratch: yes

replace:
    '[\\/]': _
    ^\.: _
    '[\x00-\x1f]': _
    \.$: _
    \s+$: ''
    ^\s+: ''
    ^-: _

ui:
    color: yes

paths:
    default: $albumartist_credit/($original_year) $album%aunique{albumartist album year,albumtype label catalognum albumdisambig}/%if{$multidisc,Disc${disc}%if{$disctitle, - $disctitle}/}$track $title
    singleton: $artist/-Misc-/$title
    comp: Various Artists/$album%aunique{albumartist album year,albumtype label catalognum albumdisambig} ($year)/%if{$multidisc,Disc$disc%if{$disctitle, - $disctitle}/}$track $title
    ext:cue: $albumpath/$artist - $album
    ext:log: $albumpath/$artist - $album
    ext:jpg: $albumpath/cover
    ext:jpeg: $albumpath/cover
    ext:png: $albumpath/cover
item_fields:
    multidisc: 1 if disctotal > 1 else 0

match:
    strong_rec_thresh: 0.04
    medium_rec_thresh: 0.25
    rec_gap_thresh: 0.25
    max_rec:
        missing_tracks: medium
        unmatched_tracks: medium
    preferred:
        countries:
        - US
        - GB|UK

musicbrainz:
    searchlimit: 5
art_filename: cover
fetchart:
    auto: yes
    cautious: yes
    minwidth: 450
    maxwidth: 1010
    enforce_ratio: 1.5%
    sources: filesystem albumart amazon wikipedia coverart fanarttv google
    google_key: REDACTED
    store_source: yes
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
embedart:
    auto: no
    maxwidth: 300
    compare_threshold: 0        - AU
        - AR
        - ES
    ifempty: no
    remove_art_file: no
thumbnails:
    auto: yes
    force: no
    dolphin: no
replaygain:
    auto: yes
    backend: bs1770gain
    overwrite: yes
    targetlevel: 89
    r128: [Opus]
    chunk_at: 5000
    method: replaygain
wlg:
    auto: yes
    force: yes
    count: 4
    whitelist: ~/.whatlastgenre/genres.txt
    separator: ', '
mpdstats:
    rating_mix: 0.75
zero:
    auto: yes
    fields: images
    update_database: yes
    keep_fields: []
smartplaylist:
    relative_to: /net/nfs4/server/mediacentre/Music/Library/
    playlist_dir: /net/nfs4/server/mediacentre/Music/Playlists/
    playlists: [{name: Loved.m3u, query: 'loved:1'}, {name: Genre_acoustic-country-folk-americana.m3u, album_query: ['genre:Folk', 'genre:Country', 'genre:Acoustic', 'genre:Americana']}]
    auto: yes
types:
    loved: int
    play_count: int
lastfm:
    user: REDACTED
    api_key: REDACTED
play:
    command: mpv
    use_folders: no
    relative_to:
    raw: no
    warning_threshold: 100
copyartifacts:
    extensions: .cue .log .jpg .jpeg .png
    print_ignored: yes
acousticbrainz:
    auto: yes
    force: no
    tags: []
absubmit:
    auto: yes
    extractor: /usr/bin/streaming_extractor_music
chroma:
    auto: yes
acoustid:
    apikey: REDACTED
lastimport:
    per_page: 500
    retry_limit: 3
missing:
    count: no
    total: no
    album: no
rewrite: {}
pathfields: {}
album_fields: {}
edit:
    albumfields: album albumartist
    itemfields: track title artist album
    ignore_fields: id path
duplicates:
    album: no
    checksum: ''
    copy: ''
    count: no
    delete: no
    format: ''
    full: no
    keys: []
    merge: no
    move: ''
    path: no
    tiebreak: {}
    strict: no
    tag: ''
fuzzy:
    prefix: '~'
    threshold: 0.7
mbsubmit:
    format: $track. $title - $artist ($length)
    threshold: medium

More generally I think the logic of absubmit should be something like acousticbrainz - it should run only on tracks without acoustic data and the newly created data should automatically be retrieved from acousticbrainz afterwards (ie: running beet absubmit on one's entire collection should perform audio analysis only on tracks with no acoustibrainz data, then retrieve that data to the tracks).

sampsyo commented 6 years ago

Hello! I don't believe the absubmit plugin has an auto config option. As far as I can tell, this is just a mistake in the documentation: perhaps the original implementor intended to add this option and never did. Seems like a reasonable thing to add, though—should we make this a feature request?

lhupitr commented 6 years ago

Oh, well that would explain it then. Yes I guess it should be a feature request.

What are your thoughts on making it only function on tracks with no acousticbrainz data and then automatically triggering acousticbrainz to retrieve the newly created data after?

sampsyo commented 6 years ago

Cool!

That all sounds good—like the lyrics or lastgenre plugins, it would be nice to only analyze songs that don't already have data. (And that would be overridable with a --force option, of course.)

But here's one other question: can we avoid the round-trip to get the tags to place on the file? In other words, is it possible to extract all the same data directly from the analysis to skip the cost of asking the server for the data we just sent it?

lhupitr commented 6 years ago

I don't know, isn't some part of the analysis done on their servers?

sampsyo commented 6 years ago

Not sure! Perhaps---it's worth investigating.

lhupitr commented 6 years ago

Looks like its all done client side: https://acousticbrainz.org/faq

djdembeck commented 4 years ago

Would love to see this implemented as well, didn't know auto wasn't doing anything :(