mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00: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:
parent
5cd1018db3
commit
1689cecaf7
2 changed files with 1 additions and 3 deletions
|
|
@ -169,7 +169,6 @@ from
|
||||||
and "asset_faces"."personId" = $1
|
and "asset_faces"."personId" = $1
|
||||||
and "assets"."isArchived" = $2
|
and "assets"."isArchived" = $2
|
||||||
and "assets"."deletedAt" is null
|
and "assets"."deletedAt" is null
|
||||||
and "assets"."livePhotoVideoId" is null
|
|
||||||
|
|
||||||
-- PersonRepository.getNumberOfPeople
|
-- PersonRepository.getNumberOfPeople
|
||||||
select
|
select
|
||||||
|
|
|
||||||
|
|
@ -314,8 +314,7 @@ export class PersonRepository {
|
||||||
.onRef('assets.id', '=', 'asset_faces.assetId')
|
.onRef('assets.id', '=', 'asset_faces.assetId')
|
||||||
.on('asset_faces.personId', '=', personId)
|
.on('asset_faces.personId', '=', personId)
|
||||||
.on('assets.isArchived', '=', false)
|
.on('assets.isArchived', '=', false)
|
||||||
.on('assets.deletedAt', 'is', null)
|
.on('assets.deletedAt', 'is', null),
|
||||||
.on('assets.livePhotoVideoId', 'is', null),
|
|
||||||
)
|
)
|
||||||
.select((eb) => eb.fn.count(eb.fn('distinct', ['assets.id'])).as('count'))
|
.select((eb) => eb.fn.count(eb.fn('distinct', ['assets.id'])).as('count'))
|
||||||
.executeTakeFirst();
|
.executeTakeFirst();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue