From a21112e4ab37c9bb301ecd3ad50b7197f4b54a65 Mon Sep 17 00:00:00 2001 From: martin <74269598+martabal@users.noreply.github.com> Date: Thu, 27 Jul 2023 04:14:50 +0200 Subject: [PATCH] fix: people in shared assets (#3431) * fix: people in shared assets * use empty array --- server/src/immich/api-v1/asset/asset.service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/immich/api-v1/asset/asset.service.ts b/server/src/immich/api-v1/asset/asset.service.ts index 61520a9b06..7fe2bb80ee 100644 --- a/server/src/immich/api-v1/asset/asset.service.ts +++ b/server/src/immich/api-v1/asset/asset.service.ts @@ -207,12 +207,13 @@ export class AssetService { const allowExif = this.getExifPermission(authUser); const asset = await this._assetRepository.getById(assetId); + const data = allowExif ? mapAsset(asset) : mapAssetWithoutExif(asset); - if (allowExif) { - return mapAsset(asset); - } else { - return mapAssetWithoutExif(asset); + if (data.ownerId !== authUser.id) { + data.people = []; } + + return data; } public async updateAsset(authUser: AuthUserDto, assetId: string, dto: UpdateAssetDto): Promise {