move collection rename before remove deleted files

This commit is contained in:
Abhinav 2023-04-26 14:50:29 +05:30
parent 5ff2ff4a30
commit be82215a13

View file

@ -275,16 +275,6 @@ class ExportService {
);
const collectionIDNameMap = getCollectionNameMap(collections);
const removedFileUIDs = getDeletedExportedFiles(
userPersonalFiles,
exportRecord
);
if (removedFileUIDs?.length > 0) {
addLogLine(`removing ${removedFileUIDs.length} files`);
await this.fileRemover(removedFileUIDs, exportDir);
}
const renamedCollections = getRenamedCollections(
userCollections,
exportRecord
@ -302,6 +292,16 @@ class ExportService {
);
}
const removedFileUIDs = getDeletedExportedFiles(
userPersonalFiles,
exportRecord
);
if (removedFileUIDs?.length > 0) {
addLogLine(`removing ${removedFileUIDs.length} files`);
await this.fileRemover(removedFileUIDs, exportDir);
}
const filesToExport = getUnExportedFiles(
userPersonalFiles,
exportRecord