mirror of
https://github.com/beetbox/beets.git
synced 2025-12-07 17:16:07 +01:00
Before, each year, month, and day field used packing to store its values in the same tag but at different positions. We then instantiated a `CompositeDateField` to combine the different values. This lead to code duplication in the storage styles for these fields. It also inverted the data dependency. It's more natural to think of year, month, and day as part of a date then as of a date as composed of these. Now, only `DateField` class stores data in the files tag. This makes sense: One tag, one field that accesses it. To obtain access to the year, month, and day parts, the DateField is equipped with factories that create `DateItemField` instances associated to a `DateField`. These descriptor allow us to get and set parts of a date field.
8.4 KiB
8.4 KiB