aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-07-25 22:26:14 -0700
committerFuwn <[email protected]>2023-07-25 22:26:14 -0700
commitf856dff1ed18ff298e2c6c6f21e410a6785f5728 (patch)
treeaa22234fd0654daab7d2aa7ee4f42af40e7e1d63
parentfeat(due): toggle missing display (diff)
downloadold.due.moe-f856dff1ed18ff298e2c6c6f21e410a6785f5728.tar.xz
old.due.moe-f856dff1ed18ff298e2c6c6f21e410a6785f5728.zip
fix(html): keep manga status on shows
-rw-r--r--src/due/routes/index.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/due/routes/index.py b/src/due/routes/index.py
index 7dd0dbd..9899b5b 100644
--- a/src/due/routes/index.py
+++ b/src/due/routes/index.py
@@ -12,7 +12,6 @@ bp = Blueprint("index", __name__)
def home():
response = make_response("")
disable_manga = True
- show_missing = False
if request.args.get("show_manga") is not None:
disable_manga = False
@@ -24,14 +23,13 @@ def home():
response.set_cookie("hide_message", "1")
if request.args.get("toggle_missing") is not None:
- if request.cookies.get("show_missing") is None:
- response = redirect("/")
- show_missing = True
+ response = redirect(
+ f"/{'?show_manga' if request.args.get('show_manga') is not None else ''}"
+ )
+ if request.cookies.get("show_missing") is None:
response.set_cookie("show_missing", "1")
else:
- response = redirect("/")
-
response.delete_cookie("show_missing")
# print(
@@ -106,7 +104,7 @@ def home():
f"""<a href="/auth/logout">Logout from AniList ({name})</a>
<br>""",
- f"""<a href=\"/?toggle_missing\">{'Show' if request.cookies.get('show_missing') else 'Hide'} missing</a><p></p><details open>
+ f"""<a href=\"/?toggle_missing{'&show_manga' if request.args.get('show_manga') is not None else ''}\">{'Show' if request.cookies.get('show_missing') else 'Hide'} unresolved</a><p></p><details open>
<summary>Anime [{anime_length}] <small style="opacity: 50%">{round(anime_time, 2)}s</small></summary>
{anime_html}
</details>