Use
This commit is contained in:
parent
72dd47fa7b
commit
eeb1952585
2 changed files with 5 additions and 8 deletions
|
@ -1,3 +1,4 @@
|
|||
import { ensureElectron } from "@/next/electron";
|
||||
import log from "@/next/log";
|
||||
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
|
||||
import { User } from "@ente/shared/user/types";
|
||||
|
@ -197,6 +198,7 @@ async function migrateCollectionFolders(
|
|||
exportDir: string,
|
||||
collectionIDPathMap: Map<number, string>,
|
||||
) {
|
||||
const fs = ensureElectron().fs;
|
||||
for (const collection of collections) {
|
||||
const oldCollectionExportPath = getOldCollectionFolderPath(
|
||||
exportDir,
|
||||
|
@ -208,13 +210,8 @@ async function migrateCollectionFolders(
|
|||
collection.name,
|
||||
);
|
||||
collectionIDPathMap.set(collection.id, newCollectionExportPath);
|
||||
if (!(await exportService.exists(oldCollectionExportPath))) {
|
||||
continue;
|
||||
}
|
||||
await exportService.rename(
|
||||
oldCollectionExportPath,
|
||||
newCollectionExportPath,
|
||||
);
|
||||
if (!(await fs.exists(oldCollectionExportPath))) continue;
|
||||
await fs.rename(oldCollectionExportPath, newCollectionExportPath);
|
||||
await addCollectionExportedRecordV1(
|
||||
exportDir,
|
||||
collection.id,
|
||||
|
|
|
@ -81,4 +81,4 @@ export const safeFileName = async (directoryPath: string, name: string) => {
|
|||
* Return true if an item exists an the given {@link path} on the user's local
|
||||
* filesystem.
|
||||
*/
|
||||
export const exists = (path: string) => ensureElectron().fs.exists(path);
|
||||
const exists = (path: string) => ensureElectron().fs.exists(path);
|
||||
|
|
Loading…
Add table
Reference in a new issue