Make naming consistent with the field name

This commit is contained in:
Šarūnas Nejus 2025-10-05 13:02:13 +01:00
parent 6e5af90abb
commit 60e0efb8ea
No known key found for this signature in database
5 changed files with 10 additions and 5 deletions

View file

@ -166,7 +166,7 @@ match:
missing_tracks: medium
unmatched_tracks: medium
distance_weights:
source: 2.0
data_source: 2.0
artist: 3.0
album: 3.0
media: 1.0

View file

@ -133,7 +133,9 @@ def _get_distance(
dist = Distance()
if info.data_source == data_source:
dist.add("source", config["data_source_mismatch_penalty"].as_number())
dist.add(
"data_source", config["data_source_mismatch_penalty"].as_number()
)
return dist

View file

@ -66,6 +66,9 @@ Other changes:
disambiguation stripping.
- When installing ``beets`` via git or locally the version string now reflects
the current git branch and commit hash. :bug:`4448`
- :ref:`match-config`: ``match.distance_weights.source`` configuration has been
renamed to ``match.distance_weights.data_source`` for consistency with the
name of the field it refers to.
For developers and plugin authors:

View file

@ -935,7 +935,7 @@ can be one of ``none``, ``low``, ``medium`` or ``strong``. When the maximum
recommendation is ``strong``, no "downgrading" occurs. The available penalty
names here are:
- source
- data_source
- artist
- album
- media

View file

@ -22,7 +22,7 @@ class TestDistance:
@pytest.fixture
def dist(self, config):
config["match"]["distance_weights"]["source"] = 2.0
config["match"]["distance_weights"]["data_source"] = 2.0
config["match"]["distance_weights"]["album"] = 4.0
config["match"]["distance_weights"]["medium"] = 2.0
@ -103,7 +103,7 @@ class TestDistance:
assert dist["media"] == 1 / 6
def test_operators(self, dist):
dist.add("source", 0.0)
dist.add("data_source", 0.0)
dist.add("album", 0.5)
dist.add("medium", 0.25)
dist.add("medium", 0.75)