feat(server): do not automatically download android motion videos (#11774)

feat(server): do not automatically download embedded android motion videos
This commit is contained in:
Jason Rasmussen
2024-08-15 16:06:16 -04:00
committed by GitHub
parent ed6971222c
commit 32c05ea950
13 changed files with 151 additions and 28 deletions

View File

@@ -226,5 +226,31 @@ describe(DownloadService.name, () => {
],
});
});
it('should skip the video portion of an android live photo by default', async () => {
const assetIds = [assetStub.livePhotoStillAsset.id];
const assets = [
assetStub.livePhotoStillAsset,
{ ...assetStub.livePhotoMotionAsset, originalPath: 'upload/encoded-video/uuid-MP.mp4' },
];
accessMock.asset.checkOwnerAccess.mockResolvedValue(new Set(assetIds));
assetMock.getByIds.mockImplementation(
(ids) =>
Promise.resolve(
ids.map((id) => assets.find((asset) => asset.id === id)).filter((asset) => !!asset),
) as Promise<AssetEntity[]>,
);
await expect(sut.getDownloadInfo(authStub.admin, { assetIds })).resolves.toEqual({
totalSize: 25_000,
archives: [
{
assetIds: [assetStub.livePhotoStillAsset.id],
size: 25_000,
},
],
});
});
});
});