This commit is contained in:
codey 2024-08-13 10:36:53 -04:00
parent 72abef1092
commit a603366427

View File

@ -45,6 +45,12 @@ class LyricSearch(FastAPI):
self.endpoint_name = "lyric_search"
self.endpoint2_name = "lyric_cache_list"
self.endpoints = {
"lyric_search": self.lyric_search_handler,
"lyric_cache_list": self.lyric_cache_list_handler,
}
self.acceptable_request_sources = [
"WEB",
"IRC-MS",
@ -55,8 +61,8 @@ class LyricSearch(FastAPI):
"LIMNORIA-SHARED"
]
app.add_api_route(f"/{self.endpoint_name}/",self.lyric_search_handler, methods=["POST"])
app.add_api_route(f"/{self.endpoint2_name}/",self.lyric_cache_list_handler, methods=["POST"]) # pylint: disable=trailing-whitespace
for endpoint, handler in self.endpoints.items():
app.add_api_route(f"/{endpoint}/", handler, methods=["POST"])
async def lyric_cache_list_handler(self):
"""