Skip to content

Avoid needless field writes via dirty tracking in Item #656

@sampsyo

Description

@sampsyo

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.

Metadata

Metadata

Assignees

Labels

featurefeatures we would like to implement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions