From 10aec38c05e9d612e83672f5ac944b53a464b815 Mon Sep 17 00:00:00 2001 From: TylerCG <117808427+TylerCG@users.noreply.github.com> Date: Sun, 27 Apr 2025 20:34:02 -0400 Subject: [PATCH] test --- app/main.py | 21 +++++++ app/templates/dropout.html | 121 +++++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 app/templates/dropout.html diff --git a/app/main.py b/app/main.py index 0664da3..d6da3b8 100644 --- a/app/main.py +++ b/app/main.py @@ -18,6 +18,20 @@ loop = asyncio.get_running_loop() # JSON cache cached_data = None +def shows(): + html = '' + global cached_data + accepted_D20 = ('Dimension 20', 'Dimension 20 Animated', "Dimension 20's Adventuring Party") + for item in cached_data: + if 'Dimension 20' in item['SHOW']: + if item['SHOW'] in accepted_D20: + name = item['SHOW'] + html += '' + else: + name = item['SHOW'] + html += '' + return html + # api @app.get("/dropout/update") async def dropoutUpdate(): @@ -106,3 +120,10 @@ async def webpage(request: Request): return templates.TemplateResponse("ydl.html", {"request": request}) except Exception as e: return JSONResponse(status_code=500, content={"status": "error", "message": str(e)}) + +@app.get("/dropout", include_in_schema=False) +async def webpage(request: Request): + try: + return templates.TemplateResponse("dropout.html", {"request": request, "shows": shows()}) + except Exception as e: + return JSONResponse(status_code=500, content={"status": "error", "message": str(e)}) diff --git a/app/templates/dropout.html b/app/templates/dropout.html new file mode 100644 index 0000000..9818242 --- /dev/null +++ b/app/templates/dropout.html @@ -0,0 +1,121 @@ + + +
+