beets icon indicating copy to clipboard operation
beets copied to clipboard

modify: don't require -a for album-level fields

Open sampsyo opened this issue 11 years ago • 1 comments

The update command (along with the mbsync) plugin spends a good amount of hairy code on keeping album-level fields in sync with item-level fields. This should be cleaned up, "librarized", and reused for the modify command.


Here's how it currently works: the album structures in the database need to have their fields updated when their constituent items change. So we update all the items in the DB, then check all of their associated albums to see whether they need to be implicitly updated to match.

In the modify command, you currently have to say beet modify -a albumartist=foo to change an album-level field. Otherwise (if you forget -a), your modifications to individual items in an album seem to be lost—templating, for example, prefers the album-level field.

So we should probably make album-level field modifications to items propagate to album structures. This would involve the same logic as the update command. In fact, the same logic is already used (via copy-n-paste, essentially) by the mbsync command. Let's put this all in one place where we can test and debug it and use it in all three places.


There's a chance that we should make this optional for the modify command. Are there exceptional circumstances where you really want to modify a track's album-level field in isolation and keep it out of sync with its album? Could happen if you like track-level genres, for instance.

sampsyo avatar Mar 01 '14 22:03 sampsyo

From #3840

Alternatively, a warning/prompt (a la beet rm) could be added if modifying an album-level field without -a, or a track-level field with -a

Could happen if you like track-level genres, for instance.

Relevant for compilations.

metronidazole avatar Jan 24 '21 01:01 metronidazole