Introduce Source class to encapsulate metadata extraction logic,
replacing scattered `get_most_common_tags` calls throughout codebase.
- Add Source class in importer.tasks with artist, name, and metadata
- Simplify `distance()` to accept Source.data instead of items list
- Update display functions to use Source objects
- Cache Source creation with @cached_property on ImportTask
This centralizes metadata handling and reduces coupling between
autotag and library modules.
- Handle formats as strings ONLY and evaluate them through a shared
cached template helper.
- This removes the need for conditional logic that acts on Template
objects or strings.
- Removing the coverage omit configuration exposed unused branches, helpers, and
fixtures across the test suite.
- Delete that redundant logic and simplify affected tests while preserving their
behavior.
When using `beet mod -a` to set a multi-value field (e.g. artists,
genres, composers) on an album, the value string was being split into
individual characters when propagated to items. This happened because:
1. `Album._type('artists')` returned `DEFAULT` since `artists` is not
an Album fixed field, so `_parse` returned a plain string.
2. `DelimitedString.normalize` fell through to `model_type(value)`
(= `list(value)`) for string input, splitting it into characters.
Two fixes:
- `DelimitedString.normalize`: handle string input by parsing it
(splitting by delimiter if present) instead of calling `list()`.
- `Model._type`: fall back to the related model's field/type
definitions so multi-value field types are recognized on both
Album and Item.
Fixes#5690
Update all references in core, plugins, and tests to import UserError
from the new location. This centralizes exception handling and improves
code organization.
Convert item paths to relative on write and back to absolute on read,
keeping the database free of hardcoded library directory. Fix tests to
account for absolute path return values.
Replace multiple small tests with two comprehensive snapshot tests
covering the same edge cases and newline and column layouts.
Use BeetsTestCase to ensure that the local dev config is ignored.