From b854a3dd47073890be8dfdbab4a1be2cda372dc1 Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Fri, 30 May 2025 20:26:35 +0530 Subject: [PATCH] feat(server): add originalFileName to SyncAssetV1 (#18767) Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex --- mobile/openapi/lib/model/sync_asset_v1.dart | Bin 11746 -> 12089 bytes open-api/immich-openapi-specs.json | 4 ++++ server/src/database.ts | 1 + server/src/dtos/sync.dto.ts | 1 + server/src/queries/sync.repository.sql | 2 ++ .../test/medium/specs/sync/sync-asset.spec.ts | 3 +++ .../specs/sync/sync-partner-asset.spec.ts | 3 +++ 7 files changed, 14 insertions(+) diff --git a/mobile/openapi/lib/model/sync_asset_v1.dart b/mobile/openapi/lib/model/sync_asset_v1.dart index f5d59b6ae9d3197cafbe0dd48a22a63640e37f0f..a3aa7365adb9697b4b25a956d3037121967c7bbd 100644 GIT binary patch delta 259 zcmaD9y)$k@C=-8CW_o5`Vvbv8PO4vGZt7%4CXvk{OahF&C=#1PnO`z0q6p=tD%jd8 z!B*nO|{-^%cH}B a;rM(3B_VV(G!-|;30SkE`KM1jL<|6;b6X_< delta 47 zcmV+~0MP%rUgBG@RRXhl0uKSRqyyRkv# { it('should detect and sync the first asset', async () => { const { auth, sut, getRepository, testSync } = await setup(); + const originalFileName = 'firstAsset'; const checksum = '1115vHcVkZzNp3Q9G+FEA0nu6zUbGb4Tj4UOXkN0wRA='; const thumbhash = '2225vHcVkZzNp3Q9G+FEA0nu6zUbGb4Tj4UOXkN0wRA='; const date = new Date().toISOString(); const assetRepo = getRepository('asset'); const asset = mediumFactory.assetInsert({ + originalFileName, ownerId: auth.user.id, checksum: Buffer.from(checksum, 'base64'), thumbhash: Buffer.from(thumbhash, 'base64'), @@ -48,6 +50,7 @@ describe.concurrent(SyncEntityType.AssetV1, () => { ack: expect.any(String), data: { id: asset.id, + originalFileName, ownerId: asset.ownerId, thumbhash, checksum, diff --git a/server/test/medium/specs/sync/sync-partner-asset.spec.ts b/server/test/medium/specs/sync/sync-partner-asset.spec.ts index 70e31eca4..125047b1b 100644 --- a/server/test/medium/specs/sync/sync-partner-asset.spec.ts +++ b/server/test/medium/specs/sync/sync-partner-asset.spec.ts @@ -23,6 +23,7 @@ describe.concurrent(SyncRequestType.PartnerAssetsV1, () => { it('should detect and sync the first partner asset', async () => { const { auth, sut, getRepository, testSync } = await setup(); + const originalFileName = 'firstPartnerAsset'; const checksum = '1115vHcVkZzNp3Q9G+FEA0nu6zUbGb4Tj4UOXkN0wRA='; const thumbhash = '2225vHcVkZzNp3Q9G+FEA0nu6zUbGb4Tj4UOXkN0wRA='; const date = new Date().toISOString(); @@ -34,6 +35,7 @@ describe.concurrent(SyncRequestType.PartnerAssetsV1, () => { const assetRepo = getRepository('asset'); const asset = mediumFactory.assetInsert({ ownerId: user2.id, + originalFileName, checksum: Buffer.from(checksum, 'base64'), thumbhash: Buffer.from(thumbhash, 'base64'), fileCreatedAt: date, @@ -56,6 +58,7 @@ describe.concurrent(SyncRequestType.PartnerAssetsV1, () => { data: { id: asset.id, ownerId: asset.ownerId, + originalFileName, thumbhash, checksum, deletedAt: null,