0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-02-18 01:24:26 -05:00

fix: include live images in person view count (#16116)

* fix: include live images in person view count

Fixed an issue where the total image count in the person view excluded live images.
The query now correctly accounts for all relevant assets by removing the condition
that filtered out assets with a livePhotoVideoId.

Issue:
- Image count under a person’s name was inaccurate, showing only static images.

Fix:
- Removed `.on('assets.livePhotoVideoId', 'is', null)` from the LEFT JOIN condition.

Tested on:
- Web

Ran PR checklist

* chore: run make sql.

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Mangat Singh Toor | ਮੰਗਤ ਸਿੰਘ ਤੂਰ 2025-02-17 07:49:30 -08:00 committed by GitHub
parent 5cd1018db3
commit 1689cecaf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 3 deletions

View file

@ -169,7 +169,6 @@ from
and "asset_faces"."personId" = $1
and "assets"."isArchived" = $2
and "assets"."deletedAt" is null
and "assets"."livePhotoVideoId" is null
-- PersonRepository.getNumberOfPeople
select

View file

@ -314,8 +314,7 @@ export class PersonRepository {
.onRef('assets.id', '=', 'asset_faces.assetId')
.on('asset_faces.personId', '=', personId)
.on('assets.isArchived', '=', false)
.on('assets.deletedAt', 'is', null)
.on('assets.livePhotoVideoId', 'is', null),
.on('assets.deletedAt', 'is', null),
)
.select((eb) => eb.fn.count(eb.fn('distinct', ['assets.id'])).as('count'))
.executeTakeFirst();