mirror of
https://github.com/immich-app/immich.git
synced 2025-01-21 00:52:43 -05:00
fix(web): show one face for the same person in the detail panel (#4822)
This commit is contained in:
parent
330f4cadda
commit
e1e45f3f32
1 changed files with 8 additions and 1 deletions
|
@ -98,7 +98,14 @@ export function mapAsset(entity: AssetEntity, options: AssetMapOptions = {}): As
|
||||||
tags: entity.tags?.map(mapTag),
|
tags: entity.tags?.map(mapTag),
|
||||||
people: entity.faces
|
people: entity.faces
|
||||||
?.map(mapFace)
|
?.map(mapFace)
|
||||||
.filter((person): person is PersonResponseDto => person !== null && !person.isHidden),
|
.filter((person): person is PersonResponseDto => person !== null && !person.isHidden)
|
||||||
|
.reduce((people, person) => {
|
||||||
|
const existingPerson = people.find((p) => p.id === person.id);
|
||||||
|
if (!existingPerson) {
|
||||||
|
people.push(person);
|
||||||
|
}
|
||||||
|
return people;
|
||||||
|
}, [] as PersonResponseDto[]),
|
||||||
checksum: entity.checksum.toString('base64'),
|
checksum: entity.checksum.toString('base64'),
|
||||||
stackParentId: entity.stackParentId,
|
stackParentId: entity.stackParentId,
|
||||||
stack: withStack ? entity.stack?.map((a) => mapAsset(a, { stripMetadata })) ?? undefined : undefined,
|
stack: withStack ? entity.stack?.map((a) => mapAsset(a, { stripMetadata })) ?? undefined : undefined,
|
||||||
|
|
Loading…
Add table
Reference in a new issue