diff --git a/beets/autotag/match.py b/beets/autotag/match.py index 4edc0557b..e63770b13 100644 --- a/beets/autotag/match.py +++ b/beets/autotag/match.py @@ -211,10 +211,8 @@ def track_distance(item, track_info, track_index=None, incl_artist=False): dist, dist_max = 0.0, 0.0 # Check track length. - if not track_info.length: - # If there's no length to check, assume the worst. - dist += TRACK_LENGTH_WEIGHT - else: + # If there's no length to check, apply no penalty. + if track_info.length: diff = abs(item.length - track_info.length) diff = max(diff - TRACK_LENGTH_GRACE, 0.0) diff = min(diff, TRACK_LENGTH_MAX) diff --git a/docs/changelog.rst b/docs/changelog.rst index 4bcd17d57..320eecd4e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -25,6 +25,11 @@ This release focuses on making beets' path formatting vastly more powerful. directory and music file names. See :doc:`/reference/config`. * Beets now ensures that files have **unique filenames** by appending a number to any filename that would otherwise conflict with an existing file. +* The autotagging heuristics have been tweaked in situations where the + MusicBrainz database did not contain track lengths. Previously, beets + penalized matches where this was the case, leading to situations where + seemingly good matches would have poor similarity. This penalty has been + removed. * Fix an incompatibility in BPD with libmpc (the library that powers mpc and ncmpc). * Fix a crash when importing a partial match whose first track was missing.