beets/test
Šarūnas Nejus 455d620ae0
Fix data source penalty application 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.
2025-10-10 20:36:33 +01:00
..
autotag
plugins
rsrc
util
__init__.py
conftest.py
test_art_resize.py
test_autotag.py
test_config_command.py
test_datequery.py
test_dbcore.py
test_files.py
test_hidden.py
test_importer.py
test_library.py
test_logging.py
test_m3ufile.py
test_metasync.py
test_pipeline.py
test_plugins.py
test_query.py
test_release.py
test_sort.py
test_template.py
test_types.py
test_ui.py
test_ui_commands.py
test_ui_importer.py
test_ui_init.py
test_util.py
testall.py