fix(explore): fallback to full-photo thumbnail when face crop missing #657
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/face-thumbnail-404"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix
Person face thumbnails on /explore returned 404 because
ClassInstanceService.enrichPeopleFaces()unconditionally constructed face-crop URLs when a representative face existed, even when noderived_assetsrecord (face thumbnail) existed in the database.Changes
ClassInstanceService.java:
faceThumbnailKeyfield toClassInstanceRepresentativeEnrichmentrecordface_thumbnail_keyto the final SELECT inrepresentativeEnrichmentForPeople()— the two CTEs already selected it but it was not propagatedface_thumbnail_keyfaceThumbnailKeyis null,representativePreviewUrlis null (frontend already falls back torepresentativeThumbnailUrl)ClassInstanceServiceTest.java:
personWithoutFaceThumbnailReturnsNullPreviewUrlassertion (was asserting the broken behavior)enrichPeopleFacesFallsBackWhenNoThumbnailKey— verifies null preview URL when no face thumbnail existsenrichPeopleFacesUsesCroppedUrlWhenThumbnailKeyExists— verifies face-crop URL when face thumbnail key existsNo frontend changes needed
The explore page already uses:
instance.representativeCroppedThumbnailUrl ?? instance.representativeThumbnailUrlOut of scope (follow-ups)