mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
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 <balazs.keszei@clbr.hu>
This commit is contained in:
parent
b4e641548c
commit
6ae5d11ec0
@ -260,11 +260,15 @@ export class AssetRepository implements IAssetRepository {
|
|||||||
asset.isArchived = dto.isArchived ?? asset.isArchived;
|
asset.isArchived = dto.isArchived ?? asset.isArchived;
|
||||||
|
|
||||||
if (asset.exifInfo != null) {
|
if (asset.exifInfo != null) {
|
||||||
asset.exifInfo.description = dto.description || '';
|
if (dto.description !== undefined) {
|
||||||
|
asset.exifInfo.description = dto.description;
|
||||||
|
}
|
||||||
await this.exifRepository.save(asset.exifInfo);
|
await this.exifRepository.save(asset.exifInfo);
|
||||||
} else {
|
} else {
|
||||||
const exifInfo = new ExifEntity();
|
const exifInfo = new ExifEntity();
|
||||||
exifInfo.description = dto.description || '';
|
if (dto.description !== undefined) {
|
||||||
|
exifInfo.description = dto.description;
|
||||||
|
}
|
||||||
exifInfo.asset = asset;
|
exifInfo.asset = asset;
|
||||||
await this.exifRepository.save(exifInfo);
|
await this.exifRepository.save(exifInfo);
|
||||||
asset.exifInfo = exifInfo;
|
asset.exifInfo = exifInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user