cleanup/fix artist_typeahead_handler
This commit is contained in:
parent
b15fab98b8
commit
e67d2874e4
@ -90,7 +90,7 @@ class LyricSearch(FastAPI):
|
||||
})
|
||||
query: str = data.query
|
||||
typeahead_result: list[dict] = await self.cache_utils.check_typeahead(query)
|
||||
typeahead_list: list[str] = [str(r.get('artist')) for r in typeahead_result]
|
||||
typeahead_list: list[str] = [str(r['artist']) for r in typeahead_result]
|
||||
return JSONResponse(content=typeahead_list)
|
||||
|
||||
async def song_typeahead_handler(self, data: ValidTypeAheadRequest) -> JSONResponse:
|
||||
@ -183,7 +183,7 @@ class LyricSearch(FastAPI):
|
||||
})
|
||||
result['lyrics'] = " / ".join(lyric_lines[seeked_found_line:])
|
||||
|
||||
result['confidence'] = int(result.get('confidence', 0))
|
||||
result['confidence'] = int(result['confidence'])
|
||||
result['time'] = f'{float(result['time']):.4f}'
|
||||
|
||||
if plain_lyrics:
|
||||
|
@ -87,7 +87,6 @@ class Misc(FastAPI):
|
||||
'err': True,
|
||||
'errorText': 'General failure.',
|
||||
}
|
||||
logging.info("Found: %s", found_counts)
|
||||
return found_counts
|
||||
|
||||
async def homepage_radio_widget(self) -> JSONResponse:
|
||||
|
Loading…
x
Reference in New Issue
Block a user