From fca4b2aca6dff29f3b1b14cc6dcc6f891823dd7d Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Sun, 14 Apr 2024 19:29:22 +0530 Subject: [PATCH] Use also for the image --- web/apps/photos/src/services/export/index.ts | 40 +++++--------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/web/apps/photos/src/services/export/index.ts b/web/apps/photos/src/services/export/index.ts index c3cc6e7e7b..e35a78140d 100644 --- a/web/apps/photos/src/services/export/index.ts +++ b/web/apps/photos/src/services/export/index.ts @@ -755,41 +755,19 @@ class ExportService { await this.removeFileExportedRecord(exportDir, fileUID); try { if (isLivePhotoExportName(fileExportName)) { - const { - image: imageExportName, - video: videoExportName, - } = parseLivePhotoExportName(fileExportName); - const imageExportPath = `${collectionExportPath}/${imageExportName}`; - log.info( - `moving image file ${imageExportPath} to trash folder`, - ); - if (await fs.exists(imageExportPath)) { - await electron.moveFile( - imageExportPath, - await getTrashedFileExportPath( - exportDir, - imageExportPath, - ), - ); - } - - const imageMetadataFileExportPath = - getMetadataFileExportPath(imageExportPath); - - if (await fs.exists(imageMetadataFileExportPath)) { - await electron.moveFile( - imageMetadataFileExportPath, - await getTrashedFileExportPath( - exportDir, - imageMetadataFileExportPath, - ), - ); - } + const { image, video } = + parseLivePhotoExportName(fileExportName); await moveToTrash( exportDir, collectionExportName, - videoExportName, + image, + ); + + await moveToTrash( + exportDir, + collectionExportName, + video, ); } else { const fileExportPath = `${collectionExportPath}/${fileExportName}`;