Move search results into poster grid
This commit is contained in:
@@ -62,6 +62,7 @@ class HandlerContext:
|
||||
runtime_state: object
|
||||
save_runtime_config: object
|
||||
search_anime: object
|
||||
resolve_search_thumbnail: object
|
||||
test_discord_webhook_config: object
|
||||
thumbnail_file_path: object
|
||||
update_all_watchlist_statuses: object
|
||||
@@ -558,6 +559,14 @@ class Handler(BaseHTTPRequestHandler):
|
||||
if mode not in MODE_CHOICES:
|
||||
raise ValueError("Mode must be sub or dub")
|
||||
self.json({"results": Handler._context(self).search_anime(query, mode)})
|
||||
elif parsed.path == "/api/search/thumb":
|
||||
Handler._runtime(self)
|
||||
params = parse_qs(parsed.query)
|
||||
title = (params.get("title") or [""])[0].strip()
|
||||
if not title:
|
||||
raise ValueError("Title is required")
|
||||
path = Handler._context(self).resolve_search_thumbnail(title)
|
||||
self.file(path)
|
||||
elif parsed.path.startswith("/api/anime/") and parsed.path.endswith("/episodes"):
|
||||
runtime = Handler._runtime(self)
|
||||
config = runtime["config"]
|
||||
|
||||
Reference in New Issue
Block a user