beet write
: false positive for changes in fields with multiple values
#5371
Labels
beet write
: false positive for changes in fields with multiple values
#5371
Problem
It seems that for fields which allow multiple tags, the write command might incorrectly say there are changes to be made.
Backstory
I am using the albumtypes plugin to set the 'soundtrack' album type.
My relevant config looks like this:
(I opened a related discussion, which was solved.)
Basically, if 'soundtrack' appears at all in MusicBrainz's
albumtypes
list, I'll set the main albumtype to soundtrack. This is because I prefer soundtrack to be the highest priority when something belongs to multiple types.This does work; I checked the database manually, and the types are set correctly:
I also checked the files themselves and found the data to also be correct.
My issue is that when I run
beet write
, it tells me there are many changes to be made like:This never clears; if I run the command again, it tries to do this again.
The issue seems to related to this part in
mediafile
:ListMediaField.single_field
returns the first item inalbumtypes
.This comes up in the
write
command,write_items()
, where a 'clean_item` is created from the file on disk:beets/beets/ui/commands.py
Line 2285 in b88c097
It's a bit tricky, because both the file and the database are already correct, but because the write command thought there is a difference, it will attempt to write the corrections anyway.
albumtypes
) and single fields (albumtype
) for that entry, and the single field can be configured by the user to choose which one from the multiple fieldIf the above is always true, a workaround which works for me is to add
before checking for the changes here:
beets/beets/ui/commands.py
Line 2293 in b88c097
I'm not sure if this is the most robust though.
Also, I guess it could apply to other 'multiple' fields too:
Setup
The text was updated successfully, but these errors were encountered: