diff --git a/beets/config_default.yaml b/beets/config_default.yaml index 0a80f77f2..c0bab8056 100644 --- a/beets/config_default.yaml +++ b/beets/config_default.yaml @@ -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 diff --git a/beets/metadata_plugins.py b/beets/metadata_plugins.py index 3da137b51..780fe30b7 100644 --- a/beets/metadata_plugins.py +++ b/beets/metadata_plugins.py @@ -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 diff --git a/docs/changelog.rst b/docs/changelog.rst index b56413ee9..7418b51db 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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: diff --git a/docs/reference/config.rst b/docs/reference/config.rst index bc823ded4..30582d12c 100644 --- a/docs/reference/config.rst +++ b/docs/reference/config.rst @@ -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 diff --git a/test/autotag/test_distance.py b/test/autotag/test_distance.py index e3ce9f891..ffbb24eca 100644 --- a/test/autotag/test_distance.py +++ b/test/autotag/test_distance.py @@ -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)