misc/version bump
This commit is contained in:
@ -59,15 +59,6 @@ class ValidTypeAheadRequest(BaseModel):
|
||||
pre_query: str|None = None
|
||||
query: str
|
||||
|
||||
|
||||
class ValidLyricSearchLogRequest(BaseModel):
|
||||
"""
|
||||
- **webradio**: whether or not to include requests generated automatically by the radio page on codey.lol, defaults to False
|
||||
"""
|
||||
|
||||
webradio: bool = False
|
||||
|
||||
|
||||
class CacheUtils:
|
||||
"""Lyrics Cache DB Utils"""
|
||||
def __init__(self):
|
||||
@ -103,8 +94,8 @@ class LyricSearch(FastAPI):
|
||||
self.endpoints = {
|
||||
"typeahead/artist": self.artist_typeahead_handler,
|
||||
"typeahead/song": self.song_typeahead_handler,
|
||||
"lyric_search": self.lyric_search_handler,
|
||||
# "lyric_cache_list": self.lyric_cache_list_handler,
|
||||
"lyric_search": self.lyric_search_handler, # Preserving old endpoint path temporarily
|
||||
"lyric/search": self.lyric_search_handler,
|
||||
}
|
||||
|
||||
self.acceptable_request_sources = [
|
||||
@ -122,17 +113,8 @@ class LyricSearch(FastAPI):
|
||||
self.lrc_regex = regex.compile(r'\[([0-9]{2}:[0-9]{2})\.[0-9]{1,3}\](\s(.*)){0,}')
|
||||
|
||||
for endpoint, handler in self.endpoints.items():
|
||||
_schema_include = endpoint in ["lyric_search"]
|
||||
_schema_include = endpoint in ["lyric/search"]
|
||||
app.add_api_route(f"/{endpoint}", handler, methods=["POST"], include_in_schema=_schema_include)
|
||||
|
||||
# async def lyric_cache_list_handler(self):
|
||||
# """
|
||||
# Get currently cached lyrics entries
|
||||
# """
|
||||
# return {
|
||||
# 'err': False,
|
||||
# 'data': await self.lyrics_engine.listCacheEntries()
|
||||
# }
|
||||
|
||||
async def artist_typeahead_handler(self, data: ValidTypeAheadRequest):
|
||||
"""Artist Type Ahead Handler"""
|
||||
@ -160,16 +142,6 @@ class LyricSearch(FastAPI):
|
||||
typeahead_list = [str(r.get('song')) for r in typeahead_result]
|
||||
return typeahead_list
|
||||
|
||||
# async def lyric_search_log_handler(self, data: ValidLyricSearchLogRequest):
|
||||
# """Lyric Search Log Handler"""
|
||||
# include_radio = data.webradio
|
||||
# await self.glob_state.increment_counter('lyrichistory_requests')
|
||||
# last_10k_sings = await self.lyrics_engine.getHistory(limit=10000, webradio=include_radio)
|
||||
# return {
|
||||
# 'err': False,
|
||||
# 'history': last_10k_sings
|
||||
# }
|
||||
|
||||
async def lyric_search_handler(self, data: ValidLyricRequest):
|
||||
"""
|
||||
Search for lyrics
|
||||
|
Reference in New Issue
Block a user