From 6ae5d11ec0b1ce4852282987cdd104e7f31ab646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keszei=20Bal=C3=A1zs?= Date: Wed, 28 Jun 2023 19:54:48 +0200 Subject: [PATCH] chore(server): Image description disappears after toggle favorite (#3009) * Fixed asset rewrite description on toggle favorite * Fixed description removing error * Rewrite description condition for asset update --------- Co-authored-by: Balazs Keszei --- server/src/immich/api-v1/asset/asset-repository.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/immich/api-v1/asset/asset-repository.ts b/server/src/immich/api-v1/asset/asset-repository.ts index 4fd2f3c064..7b3dfea4df 100644 --- a/server/src/immich/api-v1/asset/asset-repository.ts +++ b/server/src/immich/api-v1/asset/asset-repository.ts @@ -260,11 +260,15 @@ export class AssetRepository implements IAssetRepository { asset.isArchived = dto.isArchived ?? asset.isArchived; if (asset.exifInfo != null) { - asset.exifInfo.description = dto.description || ''; + if (dto.description !== undefined) { + asset.exifInfo.description = dto.description; + } await this.exifRepository.save(asset.exifInfo); } else { const exifInfo = new ExifEntity(); - exifInfo.description = dto.description || ''; + if (dto.description !== undefined) { + exifInfo.description = dto.description; + } exifInfo.asset = asset; await this.exifRepository.save(exifInfo); asset.exifInfo = exifInfo;