Skip to content

Commit 10cb919

Browse files
committed
Implement API for querying Queue extraction of page thumbnails (placeholder)
1 parent 3005834 commit 10cb919

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

comiclib/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ def get_archive_categories(id: str, db: Session = Depends(get_db)):
241241

242242

243243
@app.get("/api/archives/{id}/thumbnail")
244-
def get_archive_thumbnail(id: str, background_tasks: BackgroundTasks, response: Response, page: Union[int, None] = None, db: Session = Depends(get_db)):
244+
def get_archive_thumbnail(id: str, background_tasks: BackgroundTasks, response: Response, page: Union[int, None] = None, no_fallback: bool = False, db: Session = Depends(get_db)):
245+
if no_fallback:
246+
return Response(status_code=status.HTTP_200_OK)
245247
a = db.get(Archive, id)
246248
if a is None:
247249
return JSONResponse({"operation": "", "error": "This ID doesn't exist on the server.", "success": 0}, status.HTTP_400_BAD_REQUEST)
@@ -256,6 +258,11 @@ def get_archive_thumbnail(id: str, background_tasks: BackgroundTasks, response:
256258
return FileResponse(thumb_path)
257259

258260

261+
@app.get("/api/archives/{id}/thumbnail")
262+
def queue_archive_thumbnail(force: bool = False):
263+
return Response(status_code=status.HTTP_200_OK)
264+
265+
259266
@app.put("/api/archives/{id}/thumbnail", dependencies=authorization)
260267
def update_thumbnail(id: str, page: int = 1, db: Session = Depends(get_db)):
261268
a = db.get(Archive, id)

0 commit comments

Comments
 (0)