fix(server): person repo methods (#12524)

This commit is contained in:
Jason Rasmussen
2024-09-10 09:48:29 -04:00
committed by GitHub
parent 27050af57b
commit d634ef2d2b
10 changed files with 85 additions and 81 deletions

View File

@@ -584,18 +584,15 @@ export class MetadataService {
this.logger.debug(`Creating missing persons: ${missing.map((p) => `${p.name}/${p.id}`)}`);
}
const newPersons = await this.personRepository.create(missing);
const newPersonIds = await this.personRepository.createAll(missing);
const faceIds = await this.personRepository.replaceFaces(asset.id, discoveredFaces, SourceType.EXIF);
this.logger.debug(`Created ${faceIds.length} faces for asset ${asset.id}`);
await this.personRepository.update(missingWithFaceAsset);
await this.personRepository.updateAll(missingWithFaceAsset);
await this.jobRepository.queueAll(
newPersons.map((person) => ({
name: JobName.GENERATE_PERSON_THUMBNAIL,
data: { id: person.id },
})),
newPersonIds.map((id) => ({ name: JobName.GENERATE_PERSON_THUMBNAIL, data: { id } })),
);
}