If I import an album making some changes with the "Edit candidates" option, beets doesn't fetch and embed the album art automatically, as it is supposed to do in my configuration.
This is what happens when I import something without making changes via "Edit candidates":
...
Apply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates? a
Sending event: import_task_choice
Sending event: import_task_apply
0 of 1 items replaced
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
fetchart: trying source filesystem for album Wolfgang Amadeus Mozart - Eine Kleine Nachtmusik / Symphony no. 40 in G minor / Symphony no. 41 "Jupiter"
fetchart: trying source coverart for album Wolfgang Amadeus Mozart - Eine Kleine Nachtmusik / Symphony no. 40 in G minor / Symphony no. 41 "Jupiter"
fetchart: downloading image: https://coverartarchive.org/release/00185b27-bb54-40fb-b5cc-b26f246a6078/front
fetchart: downloaded art to: /tmp/tmpTD9lQ9.jpg
fetchart: using remote image /tmp/tmpTD9lQ9.jpg
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: import_task_files
Sending event: art_set
embedart: Resizing album art to 600 pixels wide
artresizer: ImageMagick resizing XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/wolfgang_amadeus_mozart_0000_eine_kleine_nachtmusik___symphony_no._40_in_g_minor___symphony_no._41__jupiter_/albumart.jpg to /tmp/tmpStol6V.jpg
embedart: Embedding album art into Wolfgang Amadeus Mozart - 0000 - Eine Kleine Nachtmusik / Symphony no. 40 in G minor / Symphony no. 41 "Jupiter"
embedart: embedding /tmp/tmpStol6V.jpg
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: album_imported
Sending event: import
Sending event: cli_exit
And here's what happens when I make some changes: it seems the fetchart and embedart plugins are not called at all:
...
Enter search, enter Id, aBort, eDit, edit Candidates? c
# selection (default 1)? 1
edit: invoking editor command: ['vim', '/tmp/tmpGx7YKR.yaml']
Wolfgang Amadeus Mozart - 0000 - Eine Kleine Nachtmusik / Symphony no. 40 in G minor / Symphony no. 41 "Jupiter" - 01 - Eine Kleine Nachtmusik
title: Eine Kleine Nachtmusik -> Eine Kleine Nachtmusik test test test
continue [E]diting, Apply, Cancel? a
Sending event: import_task_choice
0 of 1 items replaced
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: import_task_files
Sending event: album_imported
Sending event: import
Sending event: cli_exit
Perhaps this might be related to #1671? Though I don't use the convert plugin, the only similarity is that the auto fetch/embedart operations during import are skipped when "something else" ("convert" or "edit candidates") happens before.
My configuration (output of beet config) is:
...
fetchart:
auto: yes
embedart:
auto: yes
...
Thank you! My suspicion is that the edit plugin is not updating the state of the ImportTask object sufficiently to allow plugins to be invoked. The next step is to go digging in import.py to examine the logic that invokes plugin stages and to do a little debugging to understand what state is causing these stages to be disabled. Volunteers would be very welcome!
I think (haven't tested) for fetchart, the problem is in this line where it should check for choices APPLY _and_ RETAG.
EDIT: There's no such conditional in embedart, but it is triggered on assigning new artwork, so the problem is probably simply the failure of fetchart before?
Indeed, that does seem like that could explain it. Thank you!
I think (haven't tested) for fetchart, the problem is in this line where it should check for choices APPLY and RETAG.
I guess you mean APPLY _or_ RETAG?
OK, I tried replacing the line https://github.com/beetbox/beets/blob/master/beetsplug/fetchart.py#L786 with
elif task.choice_flag in (importer.action.APPLY, importer.action.RETAG):
The fetchart and embedart plugins now are called as expected and the import process is successful!
DISCLAIMER: I only tried to translate @wordofglass suggestion into code, but I'm not sure if this is enough, or if more code is required for a complete solution. Anyway, it seems to work so far. :)
Cool! Could you please open a pull request with your change? That鈥檚 a good way to start a discussion about a proposed fix.