beetbox / beetbox/beets

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

Open
#561 1 comment 1 reaction 0 assignees View on GitHub
feature mediumsize
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.