From 3373be285e6da8168f35e826a3916e87bfe47ff3 Mon Sep 17 00:00:00 2001 From: gilesb Date: Sun, 11 Jan 2026 17:26:00 +0000 Subject: [PATCH] Fix recipe list links and home page recipe count - Template used recipe.id but service returns recipe.recipe_id - Add recipe count to home page stats Co-Authored-By: Claude Opus 4.5 --- app/routers/home.py | 8 ++++++++ app/templates/recipes/list.html | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/routers/home.py b/app/routers/home.py index ad0aeeb..c421f37 100644 --- a/app/routers/home.py +++ b/app/routers/home.py @@ -40,6 +40,14 @@ async def home(request: Request): stats["media"] = await database.count_user_items(user.actor_id) except Exception: pass + try: + from ..services.recipe_service import RecipeService + from ..dependencies import get_redis_client, get_cache_manager + recipe_service = RecipeService(get_redis_client(), get_cache_manager()) + recipes = await recipe_service.list_recipes(user.actor_id) + stats["recipes"] = len(recipes) + except Exception: + pass templates = get_templates(request) return render(templates, "home.html", request, diff --git a/app/templates/recipes/list.html b/app/templates/recipes/list.html index feef25d..b593dc4 100644 --- a/app/templates/recipes/list.html +++ b/app/templates/recipes/list.html @@ -15,7 +15,7 @@ {% if recipes %}
{% for recipe in recipes %} -
{{ recipe.name }}