mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix: people ordering by asset count (#19366)
This commit is contained in:
parent
a5ed453929
commit
00aa385972
3 changed files with 17 additions and 15 deletions
|
|
@ -35,8 +35,9 @@ having
|
|||
order by
|
||||
"person"."isHidden" asc,
|
||||
"person"."isFavorite" desc,
|
||||
NULLIF(person.name, '') asc nulls last,
|
||||
NULLIF(person.name, '') is null asc,
|
||||
count("asset_faces"."assetId") desc,
|
||||
NULLIF(person.name, '') asc nulls last,
|
||||
"person"."createdAt"
|
||||
limit
|
||||
$5
|
||||
|
|
|
|||
|
|
@ -180,8 +180,9 @@ export class PersonRepository {
|
|||
)
|
||||
.$if(!options?.closestFaceAssetId, (qb) =>
|
||||
qb
|
||||
.orderBy(sql`NULLIF(person.name, '')`, (om) => om.asc().nullsLast())
|
||||
.orderBy(sql`NULLIF(person.name, '') is null`, 'asc')
|
||||
.orderBy((eb) => eb.fn.count('asset_faces.assetId'), 'desc')
|
||||
.orderBy(sql`NULLIF(person.name, '')`, (om) => om.asc().nullsLast())
|
||||
.orderBy('person.createdAt'),
|
||||
)
|
||||
.$if(!options?.withHidden, (qb) => qb.where('person.isHidden', '=', false))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue