Enhance lyric search functionality by improving line splitting logic and adding multi-line matching for subsearch. Update cache handling to ensure confidence threshold is respected before returning results.
This commit is contained in:
@@ -343,15 +343,19 @@ class Cache:
|
||||
)
|
||||
else:
|
||||
best_match = (result_tracks[0], 100)
|
||||
if not best_match or confidence < 90:
|
||||
if not best_match:
|
||||
return None
|
||||
(candidate, confidence) = best_match
|
||||
if confidence < 90:
|
||||
return None
|
||||
logging.info("Result found on %s", self.label)
|
||||
matched = self.get_matched(
|
||||
sqlite_rows=results,
|
||||
matched_candidate=candidate,
|
||||
confidence=confidence,
|
||||
)
|
||||
if matched is None:
|
||||
return None
|
||||
time_end: float = time.time()
|
||||
time_diff: float = time_end - time_start
|
||||
matched.time = time_diff
|
||||
|
||||
Reference in New Issue
Block a user