The recently introduces `data_source_mismatch_penalty` property in the MetadataPlugin
class was not copied in the backwards compatibility layer. This PR
introduces a fixes this such that `cached_properties` are copied to
legacy metadata plugins.
This also includes a test for the expected behavior.
See also [beetcamp
issue](https://github.com/snejus/beetcamp/issues/85#issuecomment-3399273892).
- Modified `_get_plugin` function to use `reversed()` when iterating
through `namespace.__dict__.values()`
- This ensures that we load _the last_ plugin class found in the
namespace.
Fixes#6093
Adds a `omit_single_disc` boolean configuration option 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.
A column of disc 1 makes me feel there should be a disc 2, when most
albums are a single disc only.
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.
## Description
- removes all mailing list references in doc.
- removes outdated installation instructions (python3.8 + slackware)
- modernizes the getting started guide
closes#5462
This PR refactors the metadata source plugin architecture to fix
incorrect data source penalty calculations during import matching.
**Key Changes:**
- **Fixed distance calculation**: Removed `track_distance()` and
`album_distance()` methods from `MetadataSourcePlugin`. Data source
mismatch penalty is now calculated directly in
`beets/autotag/distance.py`, same as most of the rest of field-based
penalties.
- **Plugin registration**: Metadata source plugins now register
themselves in `_instance_by_data_source` dict on instantiation, enabling
efficient penalty lookups.
- **Renamed configuration options**:
- `source_weight` → `data_source_mismatch_penalty` (plugin-level)
- `match.distance_weights.source` → `match.distance_weights.data_source`
(global matching)
- **Documentation**: added a `yaml` block with default configuration
values to each metadata source documentation page. Included the renamed
penalty field in each to underline that it's available for each data
source.
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.