From 84d5ef9807295c6ae1fe184cc8f05ae98c305511 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 8 Jun 2010 13:45:09 -0700 Subject: [PATCH] fix first-two-candidates-gap recommendation case --- beets/autotag/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beets/autotag/__init__.py b/beets/autotag/__init__.py index 390f4624b..af5afbad0 100644 --- a/beets/autotag/__init__.py +++ b/beets/autotag/__init__.py @@ -54,7 +54,7 @@ RECOMMEND_NONE = 'RECOMMEND_NONE' # Thresholds for recommendations. STRONG_REC_THRESH = 0.03 MEDIUM_REC_THRESH = 0.2 -REC_GAP_THREH = 0.3 +REC_GAP_THRESH = 0.25 # Autotagging exceptions. class AutotagError(Exception): @@ -329,10 +329,10 @@ def tag_album(items, search_artist=None, search_album=None): elif len(dist_ordered_cands) == 1: # Only a single candidate. Medium recommendation. rec = RECOMMEND_MEDIUM - elif min_dist < MEDIUM_REC_THRESH: + elif min_dist <= MEDIUM_REC_THRESH: # Medium recommendation level. rec = RECOMMEND_MEDIUM - elif dist_ordered_cands[1][0] - min_dist <= REC_GAP_THREH: + elif dist_ordered_cands[1][0] - min_dist >= REC_GAP_THRESH: # Gap between first two candidates is large. rec = RECOMMEND_MEDIUM else: