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.
This commit is contained in:
Adrian Sampson 2012-01-01 13:49:53 -08:00
parent ca6df97ee9
commit 75d4e15e92
2 changed files with 7 additions and 4 deletions

View file

@ -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)

View file

@ -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.