From 0efb187eb1c478b43588d79e2510618aa1500bed Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 6 Jul 2026 22:32:53 -0400 Subject: [PATCH] fix(gallery): drop include_hidden before the similar() call (#141 step 1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /similar route splats **filters into similar(), which doesn't take the new include_hidden kwarg → TypeError → 500 (test_gallery_similar). Drop it like post_id; similar() has its own presentation exclusion (#1274), so the gallery-browse flag doesn't apply there. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01CDgx8bQS5YrGRK76v8HUnM --- backend/app/api/gallery.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/app/api/gallery.py b/backend/app/api/gallery.py index 5021c59..678637f 100644 --- a/backend/app/api/gallery.py +++ b/backend/app/api/gallery.py @@ -137,7 +137,11 @@ async def similar(): except (KeyError, ValueError): return jsonify({"error": "similar_to query param required"}), 400 # post_id is the exclusive post-detail view — not a similarity scope. - scope = {k: v for k, v in filters.items() if k != "post_id"} + # include_hidden is a gallery-browse flag; similar() has its OWN presentation + # exclusion (a similarity-quality concern, #1274), so drop it here (#141). + scope = { + k: v for k, v in filters.items() if k not in ("post_id", "include_hidden") + } async with get_session() as session: svc = GalleryService(session) try: