mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
fix: update assets when duplicateId
is provided as null
(#18071)
Update assets when duplicateId is provided as null
This commit is contained in:
parent
1138f6dcce
commit
118a3fc9db
@ -431,6 +431,21 @@ describe(AssetService.name, () => {
|
|||||||
{ name: JobName.SIDECAR_WRITE, data: { id: 'asset-1', dateTimeOriginal, latitude: 30, longitude: 50 } },
|
{ name: JobName.SIDECAR_WRITE, data: { id: 'asset-1', dateTimeOriginal, latitude: 30, longitude: 50 } },
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should update Assets table if duplicateId is provided as null', async () => {
|
||||||
|
mocks.access.asset.checkOwnerAccess.mockResolvedValue(new Set(['asset-1']));
|
||||||
|
|
||||||
|
await sut.updateAll(authStub.admin, {
|
||||||
|
ids: ['asset-1'],
|
||||||
|
latitude: 0,
|
||||||
|
longitude: 0,
|
||||||
|
isArchived: undefined,
|
||||||
|
isFavorite: undefined,
|
||||||
|
duplicateId: null,
|
||||||
|
rating: undefined,
|
||||||
|
});
|
||||||
|
expect(mocks.asset.updateAll).toHaveBeenCalled();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('deleteAll', () => {
|
describe('deleteAll', () => {
|
||||||
|
@ -115,10 +115,10 @@ export class AssetService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
options.isArchived != undefined ||
|
options.isArchived !== undefined ||
|
||||||
options.isFavorite != undefined ||
|
options.isFavorite !== undefined ||
|
||||||
options.duplicateId != undefined ||
|
options.duplicateId !== undefined ||
|
||||||
options.rating != undefined
|
options.rating !== undefined
|
||||||
) {
|
) {
|
||||||
await this.assetRepository.updateAll(ids, options);
|
await this.assetRepository.updateAll(ids, options);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user