Refine queue page polling
This commit is contained in:
@@ -408,6 +408,14 @@ class Handler(BaseHTTPRequestHandler):
|
||||
page = (params.get("page") or ["1"])[0]
|
||||
per_page = (params.get("per_page") or ["10"])[0]
|
||||
self.json(runtime["download_queue"].list(page=page, per_page=per_page))
|
||||
elif parsed.path.startswith("/api/queue/"):
|
||||
runtime = Handler._runtime(self)
|
||||
parts = parsed.path.strip("/").split("/")
|
||||
if len(parts) != 3:
|
||||
self.error(HTTPStatus.NOT_FOUND, "Not found")
|
||||
return
|
||||
_, _, job_id = parts
|
||||
self.json(runtime["download_queue"].get(job_id))
|
||||
elif parsed.path.startswith("/api/watchlist/thumb/"):
|
||||
runtime = Handler._runtime(self)
|
||||
show_id = unquote(parsed.path[len("/api/watchlist/thumb/") :]).strip()
|
||||
|
||||
Reference in New Issue
Block a user