From a84de0188ee7eeefa483f3964ef5e828d535b39e Mon Sep 17 00:00:00 2001 From: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> Date: Mon, 14 Sep 2026 19:10:21 +0200 Subject: [PATCH] fix: metadata extraction of faces (#31551) --- server/src/services/metadata.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/services/metadata.service.ts b/server/src/services/metadata.service.ts index b1cd9e736..e48100202 100644 --- a/server/src/services/metadata.service.ts +++ b/server/src/services/metadata.service.ts @@ -28,7 +28,6 @@ import { ReverseGeocodeResult } from 'src/repositories/map.repository.js'; import { ImmichTags } from 'src/repositories/metadata.repository.js'; import { AssetExifTable } from 'src/schema/tables/asset-exif.table.js'; import { AssetFaceTable } from 'src/schema/tables/asset-face.table.js'; -import { PersonTable } from 'src/schema/tables/person.table.js'; import { BaseService } from 'src/services/base.service.js'; import { getAssetFiles } from 'src/utils/asset.util.js'; import { isAssetChecksumConstraint } from 'src/utils/database.js'; @@ -910,7 +909,7 @@ export class MetadataService extends BaseService { const existingNameMap = new Map( existingNames.map(({ personGroupId, name }) => [name.toLowerCase(), personGroupId]), ); - const missing: (Insertable & { name: string; personGroupId: string; clusterGroupId: string })[] = []; + const missing: { name: string; ownerId: string; personGroupId: string; clusterGroupId: string }[] = []; const missingWithFaceAsset: { personGroupId: string; ownerId: string; faceAssetId: string }[] = []; const adjustedRegionInfo = this.orientRegionInfo(tags.RegionInfo, tags.Orientation); @@ -960,7 +959,9 @@ export class MetadataService extends BaseService { await this.personRepository.createGroups( missing.map((item) => ({ id: item.personGroupId, clusterGroupId: asset.clusterGroupId })), ); - await this.personRepository.createAll(missing); + await this.personRepository.createAll( + missing.map(({ name, ownerId, personGroupId }) => ({ name, ownerId, personGroupId })), + ); const jobs = missing.map( ({ personGroupId, ownerId }) =>