remove karma endpoints from schema + add webhook notification for debugging (failed lyrics searches, non-LRC)
This commit is contained in:
@ -152,7 +152,7 @@ class Karma(FastAPI):
|
||||
|
||||
for endpoint, handler in self.endpoints.items():
|
||||
app.add_api_route(
|
||||
f"/{endpoint}", handler, methods=["POST"], include_in_schema=True
|
||||
f"/{endpoint}", handler, methods=["POST"], include_in_schema=False
|
||||
)
|
||||
|
||||
async def top_karma_handler(
|
||||
|
@ -168,6 +168,10 @@ class LyricSearch(FastAPI):
|
||||
)
|
||||
|
||||
if not result:
|
||||
if not data.lrc:
|
||||
await self.notifier.send(
|
||||
"DEBUG", f"Could not locate lyrics, request was:\n`{data}`"
|
||||
)
|
||||
return JSONResponse(
|
||||
content={
|
||||
"err": True,
|
||||
|
@ -149,15 +149,12 @@ class Radio(FastAPI):
|
||||
"duration": item.get("duration"),
|
||||
}
|
||||
)
|
||||
fallback_playlist_len: int = len(
|
||||
orig_queue
|
||||
) # Used if search term is provided
|
||||
full_playlist_len: int = len(orig_queue)
|
||||
filtered_len: int = len(queue_full)
|
||||
out_json = {
|
||||
"draw": data.draw,
|
||||
"recordsTotal": (
|
||||
len(queue_full) if not data.search else fallback_playlist_len
|
||||
),
|
||||
"recordsFiltered": (len(queue_full)),
|
||||
"recordsTotal": full_playlist_len,
|
||||
"recordsFiltered": filtered_len,
|
||||
"items": queue_out,
|
||||
}
|
||||
return JSONResponse(content=out_json)
|
||||
|
Reference in New Issue
Block a user