From 75d4e15e921e6b61e6e9df0dfd3094305286e3eb Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sun, 1 Jan 2012 13:49:53 -0800 Subject: [PATCH] remove missing-length distance penalty Previously, the thinking went that if the MB database didn't have a length, we should penalize the track maximally in order to avoid prioritizing a bad match just because its information was incomplete. As it turns out, though, missing track lengths are pretty common and this was causing more problems than it was solving; this way, mysteriously high distances won't appear. --- beets/autotag/match.py | 6 ++---- docs/changelog.rst | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) 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.