progress -- change get to search for lrclib
This commit is contained in:
@ -123,8 +123,14 @@ class LyricSearch(FastAPI):
|
||||
|
||||
aggregate_search = aggregate.Aggregate()
|
||||
result = await aggregate_search.search(data.a, data.s)
|
||||
if not result:
|
||||
return {
|
||||
'err': True,
|
||||
'errorText': 'Sources exhausted, lyrics not located.',
|
||||
}
|
||||
result = result.dict()
|
||||
result['lyrics'] = regex.sub(r'(\s/\s|\n)', '<br>', result['lyrics']).strip()
|
||||
result['confidence'] = f'{float(result.get('confidence', 0)):.2f}'
|
||||
return result
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user