1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 08:31:59 +00:00

fix(server): include trashed asset during face re-index and cleanup (#4450)

This commit is contained in:
shenlong 2023-10-12 16:35:49 +00:00 committed by GitHub
parent 41af76bbe2
commit f3b17d8f73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,7 +51,7 @@ export class PersonRepository implements IPersonRepository {
}
getAllFaces(): Promise<AssetFaceEntity[]> {
return this.assetFaceRepository.find({ relations: { asset: true } });
return this.assetFaceRepository.find({ relations: { asset: true }, withDeleted: true });
}
getAll(): Promise<PersonEntity[]> {
@ -88,6 +88,7 @@ export class PersonRepository implements IPersonRepository {
.leftJoin('person.faces', 'face')
.having('COUNT(face.assetId) = 0')
.groupBy('person.id')
.withDeleted()
.getMany();
}
@ -142,7 +143,7 @@ export class PersonRepository implements IPersonRepository {
}
async getFacesByIds(ids: AssetFaceId[]): Promise<AssetFaceEntity[]> {
return this.assetFaceRepository.find({ where: ids, relations: { asset: true } });
return this.assetFaceRepository.find({ where: ids, relations: { asset: true }, withDeleted: true });
}
async getRandomFace(personId: string): Promise<AssetFaceEntity | null> {