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:
2025-10-24 13:40:55 -04:00
parent 25d1ab226e
commit c6d2bad79d
2 changed files with 63 additions and 6 deletions

View File

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