Skip to content

armgit / ente

Public Imported from GitHub
0

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

Inline

Manav Rathie268b9204efc
diff --git a/web/apps/photos/src/services/export/migration.ts b/web/apps/photos/src/services/export/migration.ts
index 0ccbb95e4a..71c4937d11 100644
--- a/web/apps/photos/src/services/export/migration.ts
+++ b/web/apps/photos/src/services/export/migration.ts
@@ -235,29 +235,21 @@ async function migrateFiles(
const collectionPath = collectionIDPathMap.get(file.collectionID);
const metadataPath = `${collectionPath}/${exportMetadataDirectoryName}`;
- const oldFileSavePath = getOldFileSavePath(collectionPath, file);
- const oldFileMetadataSavePath = `${metadataPath}/${file.id}_${oldSanitizeName(file.metadata.title)}.json`;
+ const oldFileName = `${file.id}_${oldSanitizeName(file.metadata.title)}`;
+ const oldFilePath = `${collectionPath}/${oldFileName}`;
+ const oldFileMetadataPath = `${metadataPath}/${oldFileName}.json`;
- const newFileSaveName = await safeFileName(
+ const newFileName = await safeFileName(
collectionPath,
file.metadata.title,
);
+ const newFilePath = `${collectionPath}/${newFileName}`;
+ const newFileMetadataPath = `${metadataPath}/${newFileName}.json`;
- const newFileSavePath = getFileSavePath(
- collectionPath,
- newFileSaveName,
- );
+ if (!(await exportService.exists(oldFilePath))) continue;
- const newFileMetadataSavePath = `${metadataPath}/${newFileSaveName}.json`;
-
- if (!(await exportService.exists(oldFileSavePath))) {
- continue;
- }
- await exportService.rename(oldFileSavePath, newFileSavePath);
- await exportService.rename(
- oldFileMetadataSavePath,
- newFileMetadataSavePath,
- );
+ await exportService.rename(oldFilePath, newFilePath);
+ await exportService.rename(oldFileMetadataPath, newFileMetadataPath);
}
}
@@ -507,11 +499,6 @@ const getOldCollectionFolderPath = (
collectionName: string,
) => `${dir}/${collectionID}_${oldSanitizeName(collectionName)}`;
-const getOldFileSavePath = (collectionFolderPath: string, file: EnteFile) =>
- `${collectionFolderPath}/${file.id}_${oldSanitizeName(
- file.metadata.title,
- )}`;
-
const getUniqueFileExportNameForMigration = (
collectionPath: string,
filename: string,