misc
This commit is contained in:
parent
e67d2874e4
commit
fe5ab8b2be
@ -1,3 +1,4 @@
|
|||||||
API Server Rewrite
|
API Server Rewrite
|
||||||
|
|
||||||
FastAPI - https://fastapi.tiangolo.com/
|
FastAPI - https://fastapi.tiangolo.com/
|
||||||
|
[Swagger UI](https://api.codey.lol/docs)
|
@ -114,7 +114,7 @@ class Karma(FastAPI):
|
|||||||
|
|
||||||
for endpoint, handler in self.endpoints.items():
|
for endpoint, handler in self.endpoints.items():
|
||||||
app.add_api_route(f"/{endpoint}", handler, methods=["POST"],
|
app.add_api_route(f"/{endpoint}", handler, methods=["POST"],
|
||||||
include_in_schema=False)
|
include_in_schema=True)
|
||||||
|
|
||||||
|
|
||||||
async def top_karma_handler(self, request: Request,
|
async def top_karma_handler(self, request: Request,
|
||||||
|
@ -42,11 +42,12 @@ class Radio(FastAPI):
|
|||||||
|
|
||||||
for endpoint, handler in self.endpoints.items():
|
for endpoint, handler in self.endpoints.items():
|
||||||
app.add_api_route(f"/{endpoint}", handler, methods=["POST"],
|
app.add_api_route(f"/{endpoint}", handler, methods=["POST"],
|
||||||
include_in_schema=False) # change include_in_schema to False
|
include_in_schema=True)
|
||||||
|
|
||||||
# NOTE: Not in loop because method is GET for this endpoint
|
# NOTE: Not in loop because method is GET for this endpoint
|
||||||
app.add_api_route("/radio/album_art", self.album_art_handler, methods=["GET"],
|
app.add_api_route("/radio/album_art", self.album_art_handler, methods=["GET"],
|
||||||
include_in_schema=True)
|
include_in_schema=True)
|
||||||
|
|
||||||
asyncio.get_event_loop().run_until_complete(self.radio_util.load_playlist())
|
asyncio.get_event_loop().run_until_complete(self.radio_util.load_playlist())
|
||||||
asyncio.get_event_loop().run_until_complete(self.radio_util._ls_skip())
|
asyncio.get_event_loop().run_until_complete(self.radio_util._ls_skip())
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class Transcriptions(FastAPI):
|
|||||||
|
|
||||||
for endpoint, handler in self.endpoints.items():
|
for endpoint, handler in self.endpoints.items():
|
||||||
app.add_api_route(f"/{endpoint}", handler, methods=["POST"],
|
app.add_api_route(f"/{endpoint}", handler, methods=["POST"],
|
||||||
include_in_schema=False)
|
include_in_schema=True)
|
||||||
|
|
||||||
async def get_episodes_handler(self, data: ValidShowEpisodeListRequest) -> JSONResponse:
|
async def get_episodes_handler(self, data: ValidShowEpisodeListRequest) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user