fix(server): regenerate (extract) motion videos (#9438)

This commit is contained in:
Jason Rasmussen
2024-05-13 16:38:11 -04:00
committed by GitHub
parent b7ebf3152f
commit 1bebc7368c
2 changed files with 16 additions and 8 deletions
+6 -1
View File
@@ -459,10 +459,14 @@ describe(MetadataService.name, () => {
storageMock.readFile.mockResolvedValue(video);
await sut.handleMetadataExtraction({ id: assetStub.livePhotoStillAsset.id });
expect(jobMock.queue).toHaveBeenNthCalledWith(2, {
expect(jobMock.queue).toHaveBeenNthCalledWith(1, {
name: JobName.ASSET_DELETION,
data: { id: assetStub.livePhotoStillAsset.livePhotoVideoId },
});
expect(jobMock.queue).toHaveBeenNthCalledWith(2, {
name: JobName.METADATA_EXTRACTION,
data: { id: 'random-uuid' },
});
});
it('should not create a new motion photo video asset if the hash of the extracted video matches an existing asset', async () => {
@@ -477,6 +481,7 @@ describe(MetadataService.name, () => {
assetMock.getByChecksum.mockResolvedValue(assetStub.livePhotoMotionAsset);
const video = randomBytes(512);
storageMock.readFile.mockResolvedValue(video);
storageMock.checkFileExists.mockResolvedValue(true);
await sut.handleMetadataExtraction({ id: assetStub.livePhotoStillAsset.id });
expect(assetMock.create).toHaveBeenCalledTimes(0);