mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(server): add originalFileName to SyncAssetV1 (#18767)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
aebd68e24e
commit
b854a3dd47
7 changed files with 23 additions and 1 deletions
|
|
@ -23,12 +23,14 @@ describe.concurrent(SyncEntityType.AssetV1, () => {
|
|||
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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue