Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Write export record after operation completion

Manav Rathi63c38427708e
diff --git a/web/apps/photos/src/services/export/index.ts b/web/apps/photos/src/services/export/index.ts
index de84e28596..786932ff82 100644
--- a/web/apps/photos/src/services/export/index.ts
+++ b/web/apps/photos/src/services/export/index.ts
@@ -734,38 +734,31 @@ class ExportService {
const collectionExportName =
collectionIDExportNameMap.get(collectionID);
- await this.removeFileExportedRecord(exportDir, fileUID);
- try {
- if (isLivePhotoExportName(fileExportName)) {
- const { image, video } =
- parseLivePhotoExportName(fileExportName);
+ if (isLivePhotoExportName(fileExportName)) {
+ const { image, video } =
+ parseLivePhotoExportName(fileExportName);
- await moveToTrash(
- exportDir,
- collectionExportName,
- image,
- );
+ await moveToTrash(
+ exportDir,
+ collectionExportName,
+ image,
+ );
- await moveToTrash(
- exportDir,
- collectionExportName,
- video,
- );
- } else {
- await moveToTrash(
- exportDir,
- collectionExportName,
- fileExportName,
- );
- }
- } catch (e) {
- await this.addFileExportedRecord(
+ await moveToTrash(
+ exportDir,
+ collectionExportName,
+ video,
+ );
+ } else {
+ await moveToTrash(
exportDir,
- fileUID,
+ collectionExportName,
fileExportName,
);
- throw e;
}
+
+ await this.removeFileExportedRecord(exportDir, fileUID);
+
log.info(`Moved file id ${fileUID} to Trash`);
} catch (e) {
log.error("trashing failed for a file", e);