From 0ed89e61ec29265bee40538273d6cf5175cf661f Mon Sep 17 00:00:00 2001 From: martin <74269598+martabal@users.noreply.github.com> Date: Mon, 1 Jan 2024 17:07:42 +0100 Subject: [PATCH] fix: remove archived people from explore (#6091) --- server/src/infra/repositories/person.repository.ts | 1 + server/src/infra/sql/person.repository.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/server/src/infra/repositories/person.repository.ts b/server/src/infra/repositories/person.repository.ts index ed0fab8d04..64fe71d1fe 100644 --- a/server/src/infra/repositories/person.repository.ts +++ b/server/src/infra/repositories/person.repository.ts @@ -82,6 +82,7 @@ export class PersonRepository implements IPersonRepository { .leftJoin('person.faces', 'face') .where('person.ownerId = :userId', { userId }) .innerJoin('face.asset', 'asset') + .andWhere('asset.isArchived = false') .orderBy('person.isHidden', 'ASC') .addOrderBy("NULLIF(person.name, '') IS NULL", 'ASC') .addOrderBy('COUNT(face.assetId)', 'DESC') diff --git a/server/src/infra/sql/person.repository.sql b/server/src/infra/sql/person.repository.sql index 05fd4b80d0..88cde3d4cf 100644 --- a/server/src/infra/sql/person.repository.sql +++ b/server/src/infra/sql/person.repository.sql @@ -99,6 +99,7 @@ FROM AND ("asset"."deletedAt" IS NULL) WHERE "person"."ownerId" = $1 + AND "asset"."isArchived" = false AND "person"."isHidden" = false GROUP BY "person"."id"