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"