mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix: people ordering incorrect (#19298)
This commit is contained in:
parent
747a72120e
commit
fe91b44ab9
3 changed files with 98 additions and 19 deletions
|
|
@ -12,6 +12,37 @@ delete from "person"
|
|||
where
|
||||
"person"."id" in ($1)
|
||||
|
||||
-- PersonRepository.getAllForUser
|
||||
select
|
||||
"person".*
|
||||
from
|
||||
"person"
|
||||
inner join "asset_faces" on "asset_faces"."personId" = "person"."id"
|
||||
inner join "assets" on "asset_faces"."assetId" = "assets"."id"
|
||||
and "assets"."visibility" = 'timeline'
|
||||
and "assets"."deletedAt" is null
|
||||
where
|
||||
"person"."ownerId" = $1
|
||||
and "asset_faces"."deletedAt" is null
|
||||
and "person"."isHidden" = $2
|
||||
group by
|
||||
"person"."id"
|
||||
having
|
||||
(
|
||||
"person"."name" != $3
|
||||
or count("asset_faces"."assetId") >= $4
|
||||
)
|
||||
order by
|
||||
"person"."isHidden" asc,
|
||||
"person"."isFavorite" desc,
|
||||
NULLIF(person.name, '') asc nulls last,
|
||||
count("asset_faces"."assetId") desc,
|
||||
"person"."createdAt"
|
||||
limit
|
||||
$5
|
||||
offset
|
||||
$6
|
||||
|
||||
-- PersonRepository.getAllWithoutFaces
|
||||
select
|
||||
"person".*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue