Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions beets/autotag/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def generic_penalty_keys(self) -> list[str]:
return [
k.replace("album_", "").replace("track_", "").replace("_", " ")
for k in self._penalties
if self[k]
]

# Access the components and their aggregates.
Expand Down
9 changes: 6 additions & 3 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ New features

See :doc:`plugins/tidal` for more information.

..
Bug fixes
~~~~~~~~~
Bug fixes
~~~~~~~~~

- :ref:`import-cmd`: Tags with a zero distance penalty are no longer shown as
differences in the match display. Previously, custom ``distance_weights``
could cause fields with no actual mismatch to appear in the ``≠`` line.

..
For plugin developers
Expand Down
6 changes: 6 additions & 0 deletions test/autotag/test_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ def test_penalties_sort(self, dist):
dist.add("medium", 0.75)
assert dist.items() == [("album", 0.25), ("medium", 0.25)]

def test_generic_penalty_keys_excludes_zero_penalties(self, dist):
dist.add("album", 0.5)
dist.add("label", 0.0)
dist.add("medium", 0.25)
assert dist.generic_penalty_keys == ["album", "medium"]

def test_update(self, dist):
dist1 = dist
dist1.add("album", 0.5)
Expand Down
Loading