fix: no thumbnail generated for motion assets (#17472)

This commit is contained in:
Alex 2025-04-08 16:07:10 -05:00 committed by GitHub
parent 4794eeca88
commit ae8af84101
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 9 deletions

View File

@ -546,7 +546,7 @@ describe(MetadataService.name, () => {
id: assetStub.livePhotoWithOriginalFileName.id,
livePhotoVideoId: fileStub.livePhotoMotion.uuid,
});
expect(mocks.asset.update).toHaveBeenCalledTimes(2);
expect(mocks.asset.update).toHaveBeenCalledTimes(3);
});
it('should extract the EmbeddedVideo tag from Samsung JPEG motion photos', async () => {
@ -598,7 +598,7 @@ describe(MetadataService.name, () => {
id: assetStub.livePhotoWithOriginalFileName.id,
livePhotoVideoId: fileStub.livePhotoMotion.uuid,
});
expect(mocks.asset.update).toHaveBeenCalledTimes(2);
expect(mocks.asset.update).toHaveBeenCalledTimes(3);
});
it('should extract the motion photo video from the XMP directory entry ', async () => {
@ -650,7 +650,7 @@ describe(MetadataService.name, () => {
id: assetStub.livePhotoWithOriginalFileName.id,
livePhotoVideoId: fileStub.livePhotoMotion.uuid,
});
expect(mocks.asset.update).toHaveBeenCalledTimes(2);
expect(mocks.asset.update).toHaveBeenCalledTimes(3);
});
it('should delete old motion photo video assets if they do not match what is extracted', async () => {
@ -673,10 +673,6 @@ describe(MetadataService.name, () => {
name: JobName.ASSET_DELETION,
data: { id: assetStub.livePhotoWithOriginalFileName.livePhotoVideoId, deleteOnDisk: true },
});
expect(mocks.job.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 () => {
@ -723,7 +719,7 @@ describe(MetadataService.name, () => {
id: assetStub.livePhotoStillAsset.id,
livePhotoVideoId: assetStub.livePhotoMotionAsset.id,
});
expect(mocks.asset.update).toHaveBeenCalledTimes(3);
expect(mocks.asset.update).toHaveBeenCalledTimes(4);
});
it('should not update storage usage if motion photo is external', async () => {

View File

@ -550,7 +550,8 @@ export class MetadataService extends BaseService {
this.storageCore.ensureFolders(motionAsset.originalPath);
await this.storageRepository.createFile(motionAsset.originalPath, video);
this.logger.log(`Wrote motion photo video to ${motionAsset.originalPath}`);
await this.jobRepository.queue({ name: JobName.METADATA_EXTRACTION, data: { id: motionAsset.id } });
await this.handleMetadataExtraction({ id: motionAsset.id });
}
this.logger.debug(`Finished motion photo video extraction for asset ${asset.id}: ${asset.originalPath}`);