浏览代码

Fix export trash movement

Manav Rathi 1 年之前
父节点
当前提交
f2a764aac2
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      web/apps/photos/src/services/export/index.ts

+ 4 - 2
web/apps/photos/src/services/export/index.ts

@@ -1398,17 +1398,19 @@ const moveToTrash = async (
 
 
     if (await fs.exists(filePath)) {
     if (await fs.exists(filePath)) {
         await fs.mkdirIfNeeded(trashDir);
         await fs.mkdirIfNeeded(trashDir);
-        const trashFilePath = await safeFileName(trashDir, fileName, fs.exists);
+        const trashFileName = await safeFileName(trashDir, fileName, fs.exists);
+        const trashFilePath = `${trashDir}/${trashFileName}`;
         await fs.rename(filePath, trashFilePath);
         await fs.rename(filePath, trashFilePath);
     }
     }
 
 
     if (await fs.exists(metadataFilePath)) {
     if (await fs.exists(metadataFilePath)) {
         await fs.mkdirIfNeeded(metadataTrashDir);
         await fs.mkdirIfNeeded(metadataTrashDir);
-        const metadataTrashFilePath = await safeFileName(
+        const metadataTrashFileName = await safeFileName(
             metadataTrashDir,
             metadataTrashDir,
             metadataFileName,
             metadataFileName,
             fs.exists,
             fs.exists,
         );
         );
+        const metadataTrashFilePath = `${metadataTrashDir}/${metadataTrashFileName}`;
         await fs.rename(metadataFilePath, metadataTrashFilePath);
         await fs.rename(metadataFilePath, metadataTrashFilePath);
     }
     }
 };
 };