remove karma endpoints from schema + add webhook notification for debugging (failed lyrics searches, non-LRC)

This commit is contained in:
2025-05-01 06:32:28 -04:00
parent 8848d3a493
commit ad43db289a
6 changed files with 21 additions and 17 deletions

View File

@ -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(

View File

@ -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,

View File

@ -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)