minor
This commit is contained in:
@ -257,7 +257,7 @@ class Cache:
|
||||
matched = self.get_matched(redis_results=redis_result, matched_candidate=candidate,
|
||||
confidence=confidence)
|
||||
|
||||
if matched:
|
||||
if matched and confidence >= 90:
|
||||
time_end: float = time.time()
|
||||
time_diff: float = time_end - time_start
|
||||
matched.confidence = confidence
|
||||
@ -295,7 +295,7 @@ class Cache:
|
||||
candidate_tracks=result_tracks)
|
||||
else:
|
||||
best_match = (result_tracks[0], 100)
|
||||
if not best_match:
|
||||
if not best_match or confidence < 90:
|
||||
return None
|
||||
(candidate, confidence) = best_match
|
||||
logging.info("Result found on %s", self.label)
|
||||
|
@ -41,6 +41,8 @@ class TrackMatcher:
|
||||
|
||||
for candidate in candidate_tracks:
|
||||
normalized_candidate = self._normalize_string(candidate[1])
|
||||
if normalized_candidate.strip().lower() == input_track.strip().lower():
|
||||
return (candidate, 100.0)
|
||||
|
||||
# Calculate various similarity scores
|
||||
exact_score = 1.0 if input_track == normalized_candidate else 0.0
|
||||
|
Reference in New Issue
Block a user