From 697fa7c64d3b2c775869f5cafc8277a7cb579a6d Mon Sep 17 00:00:00 2001 From: gilesb Date: Sun, 11 Jan 2026 16:55:14 +0000 Subject: [PATCH] Show actual media count on home page --- app/routers/home.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/routers/home.py b/app/routers/home.py index 9316c6f..ad0aeeb 100644 --- a/app/routers/home.py +++ b/app/routers/home.py @@ -21,6 +21,7 @@ async def home(request: Request): """ Home page - show README and stats. """ + import database user = await get_current_user(request) # Load README @@ -32,11 +33,19 @@ async def home(request: Request): except Exception: pass + # Get stats for current user + stats = {} + if user: + try: + stats["media"] = await database.count_user_items(user.actor_id) + except Exception: + pass + templates = get_templates(request) return render(templates, "home.html", request, user=user, readme_html=readme_html, - stats={}, + stats=stats, active_tab="home", )