Commit graph

9 commits

Author SHA1 Message Date
Sebastian Mohr
365ff6b030 Added test additions 2025-10-14 19:55:50 +02:00
Šarūnas Nejus
3b38045d01
Only penalize multi data sources on first import 2025-10-10 20:36:33 +01:00
Šarūnas Nejus
90ca0a799a
Consider unseen tracks in data source matching 2025-10-10 20:36:33 +01:00
Šarūnas Nejus
5757579e27
Improve visibility of Distance tests failures 2025-10-10 20:36:33 +01:00
Šarūnas Nejus
e6895bb52d
Reset cached_classproperty cache for every test 2025-10-10 20:36:33 +01:00
Š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
Šarūnas Nejus
60e0efb8ea
Make naming consistent with the field name 2025-10-10 20:36:33 +01:00
Šarūnas Nejus
318a840af2
Rewrite distance tests 2025-05-31 19:17:43 +01:00
Šarūnas Nejus
adbd50b237
Move distance to a separate module 2025-05-31 19:17:43 +01:00