From e67d2874e4fa90ced094e64aa45c57db0b95c316 Mon Sep 17 00:00:00 2001 From: codey Date: Sun, 16 Feb 2025 07:49:10 -0500 Subject: [PATCH] cleanup/fix artist_typeahead_handler --- endpoints/lyric_search.py | 4 ++-- endpoints/misc.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/endpoints/lyric_search.py b/endpoints/lyric_search.py index 58a29b3..ae1e301 100644 --- a/endpoints/lyric_search.py +++ b/endpoints/lyric_search.py @@ -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: diff --git a/endpoints/misc.py b/endpoints/misc.py index a55fbd3..ea74262 100644 --- a/endpoints/misc.py +++ b/endpoints/misc.py @@ -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: