From d4d8976f291fc835e5d89b99f9facbf4478a0674 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 19 May 2026 17:53:54 -0400 Subject: [PATCH] feat(integrity): image-detail payload includes integrity_status Co-Authored-By: Claude Opus 4.7 (1M context) --- backend/app/services/gallery_service.py | 1 + tests/test_gallery_service.py | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/backend/app/services/gallery_service.py b/backend/app/services/gallery_service.py index 6ef8375..834c6a6 100644 --- a/backend/app/services/gallery_service.py +++ b/backend/app/services/gallery_service.py @@ -245,6 +245,7 @@ class GalleryService: "width": record.width, "height": record.height, "size_bytes": record.size_bytes, + "integrity_status": record.integrity_status, "created_at": record.created_at.isoformat(), "thumbnail_url": thumbnail_url(record.sha256, record.mime), "image_url": f"/images/{record.path.split('/images/', 1)[-1]}", diff --git a/tests/test_gallery_service.py b/tests/test_gallery_service.py index 7be625f..ecba6bb 100644 --- a/tests/test_gallery_service.py +++ b/tests/test_gallery_service.py @@ -122,3 +122,14 @@ async def test_neighbors(db): async def test_get_image_with_tags_returns_none_for_missing(db): svc = GalleryService(db) assert await svc.get_image_with_tags(99999) is None + + +@pytest.mark.asyncio +async def test_get_image_with_tags_includes_integrity_status(db): + images = await _seed_images(db, 1) + img = images[0] + img.integrity_status = "ok" + await db.flush() + svc = GalleryService(db) + payload = await svc.get_image_with_tags(img.id) + assert payload["integrity_status"] == "ok"