change confidence to %

This commit is contained in:
2025-01-17 06:41:56 -05:00
parent 2c9c4a22a6
commit 890408f018
4 changed files with 9 additions and 6 deletions

View File

@ -206,7 +206,7 @@ class LyricSearch(FastAPI):
logging.debug("Found %s at %s, match for %s!",
line, seeked_found_line, data.sub) # REMOVEME: DEBUG
break
if not seeked_found_line:
return {
'failed_seek': True,
@ -214,7 +214,7 @@ class LyricSearch(FastAPI):
result['lyrics'] = " / ".join(lyric_lines[seeked_found_line:])
result['lyrics'] = regex.sub(r'(\s/\s|\n)', '<br>', result['lyrics']).strip()
result['confidence'] = f'{float(result.get('confidence', 0)):.2f}'
result['confidence'] = int(result.get('confidence', 0))
result['time'] = f'{float(result['time']):.4f}'
if "cached" in result['src']:
result['from_cache'] = True