Change the parameter name to omit_single_disc (vs previously zero_disc_if_single_disc)
Add return of 'fields_set' so that, if triggered by the command line `beets zero`, it will still effect the item.write.
Added tests.
Adds a zero_disc_number_if_single_disc boolean to the zero plugin for writing to files. Adds the logic that, if disctotal is set and there is only one disc in disctotal, that the disc is not set.
This keeps tags cleaner, only using disc on multi-disc albums. The disctotal is not touched, particularly as this is not usually displayed in most clients.
The field is removed only for writing the tags, but the disc number is maintained in the database to avoid breaking anything that may depend on a disc number or avoid possible loops or failed logic.
The data_source penalty was not being calculated correctly because
`_get_distance` was being called for **all** enabled metadata plugins
which eventually meant that matches were being penalised needlessly.
This commit refactors the distance calculation to:
- Remove the plugin-based track_distance() and album_distance() methods
that were applying penalties incorrectly
- Calculate data_source penalties directly in track_distance() and
distance() functions when sources don't match
- Use a centralized get_penalty() function to retrieve plugin-specific
penalty values via a registry with O(1) lookup
- Change default data_source_penalty from 0.0 to 0.5 to ensure
mismatches are penalized by default
- Add data_source to get_most_common_tags() to determine the likely
original source for comparison
This ensures that tracks and albums from different data sources are
properly penalized during matching, improving match quality and
preventing cross-source matches.
Make it obvious when beets is installed from from a non
major version. When installed locally this adds a git hash suffix and
the distance to the last release.
closes#4448
This PR moves the `vfs.py` module, which is only used by plugins, to
avoid polluting the main beets namespace. Also exposes the `vfs` and
`art` module from beets with a deprecation warning.