mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Make naming consistent with the field name
This commit is contained in:
parent
6e5af90abb
commit
60e0efb8ea
5 changed files with 10 additions and 5 deletions
|
|
@ -166,7 +166,7 @@ match:
|
||||||
missing_tracks: medium
|
missing_tracks: medium
|
||||||
unmatched_tracks: medium
|
unmatched_tracks: medium
|
||||||
distance_weights:
|
distance_weights:
|
||||||
source: 2.0
|
data_source: 2.0
|
||||||
artist: 3.0
|
artist: 3.0
|
||||||
album: 3.0
|
album: 3.0
|
||||||
media: 1.0
|
media: 1.0
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,9 @@ def _get_distance(
|
||||||
|
|
||||||
dist = Distance()
|
dist = Distance()
|
||||||
if info.data_source == data_source:
|
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
|
return dist
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,9 @@ Other changes:
|
||||||
disambiguation stripping.
|
disambiguation stripping.
|
||||||
- When installing ``beets`` via git or locally the version string now reflects
|
- When installing ``beets`` via git or locally the version string now reflects
|
||||||
the current git branch and commit hash. :bug:`4448`
|
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:
|
For developers and plugin authors:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
recommendation is ``strong``, no "downgrading" occurs. The available penalty
|
||||||
names here are:
|
names here are:
|
||||||
|
|
||||||
- source
|
- data_source
|
||||||
- artist
|
- artist
|
||||||
- album
|
- album
|
||||||
- media
|
- media
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ class TestDistance:
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def dist(self, config):
|
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"]["album"] = 4.0
|
||||||
config["match"]["distance_weights"]["medium"] = 2.0
|
config["match"]["distance_weights"]["medium"] = 2.0
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ class TestDistance:
|
||||||
assert dist["media"] == 1 / 6
|
assert dist["media"] == 1 / 6
|
||||||
|
|
||||||
def test_operators(self, dist):
|
def test_operators(self, dist):
|
||||||
dist.add("source", 0.0)
|
dist.add("data_source", 0.0)
|
||||||
dist.add("album", 0.5)
|
dist.add("album", 0.5)
|
||||||
dist.add("medium", 0.25)
|
dist.add("medium", 0.25)
|
||||||
dist.add("medium", 0.75)
|
dist.add("medium", 0.75)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue