fix(server): migrate motion part of live photo (#24688)

Co-authored-by: Nikhil Alapati <nikhilalapati@meta.com>
This commit is contained in:
Nikhil Alapati
2026-01-05 07:26:45 -08:00
committed by GitHub
parent edd3ab7cc9
commit b190423d96
2 changed files with 42 additions and 0 deletions

View File

@@ -188,6 +188,15 @@ export class StorageTemplateService extends BaseService {
const storageLabel = user?.storageLabel || null;
const filename = asset.originalFileName || asset.id;
await this.moveAsset(asset, { storageLabel, filename });
// move motion part of live photo
if (asset.livePhotoVideoId) {
const livePhotoVideo = await this.assetJobRepository.getForStorageTemplateJob(asset.livePhotoVideoId);
if (livePhotoVideo) {
const motionFilename = getLivePhotoMotionFilename(filename, livePhotoVideo.originalPath);
await this.moveAsset(livePhotoVideo, { storageLabel, filename: motionFilename });
}
}
}
this.logger.debug('Cleaning up empty directories...');