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

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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 151 additions and 28 deletions
web/src/lib/utils

View file

@ -172,13 +172,19 @@ export const downloadFile = async (asset: AssetResponseDto) => {
},
];
const isAndroidMotionVideo = (asset: AssetResponseDto) => {
return asset.originalPath.includes('encoded-video');
};
if (asset.livePhotoVideoId) {
const motionAsset = await getAssetInfo({ id: asset.livePhotoVideoId, key: getKey() });
assets.push({
filename: motionAsset.originalFileName,
id: asset.livePhotoVideoId,
size: motionAsset.exifInfo?.fileSizeInByte || 0,
});
if (!isAndroidMotionVideo(motionAsset) || get(preferences).download.includeEmbeddedVideos) {
assets.push({
filename: motionAsset.originalFileName,
id: asset.livePhotoVideoId,
size: motionAsset.exifInfo?.fileSizeInByte || 0,
});
}
}
for (const { filename, id, size } of assets) {