beetbox / beetbox/beets

Avoid needless field writes via dirty tracking in Item

Open
#656 4 comments 0 reactions 1 assignee Claimed by @sampsyo View on GitHub
feature
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

As mentioned in #157, #628, #637, etc., it is unfortunate that beets will write metadata tags that seem unnecessary. Just because beets supports the "composer" field, for example, all MP3 files get an empty frame added.

This stems from a useful motivation: to alleviate most of the code from needing to worry about the distinction between a missing field and a null-valued field. But it also means that some other software behaves badly when confronted with all these null-valued fields. ReplayGain fields are a particularly pernicious example.

We can (possibly) get the best of both world just by adding some reluctance to `Item`: it should only set fields on `MediaFile` in the `write()` method when those fields have actually changed. This would use exactly the same dirty-bit approach that the `Model` base class in dbcore uses to avoid needless database updates.

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.