chore: Various importer improvements (#6519)

* Handle new Notion export format
Clear data on file operation delete

* fix: Don't restart development server on html upload

* fix: Do not send collection created notifications on bulk import

* fix: Avoid parellelizing all uploads at once
Move import into one transaction per-collection
This commit is contained in:
Tom Moor
2024-02-10 12:21:52 -08:00
committed by GitHub
parent e608de93fb
commit 012d8c2ae7
8 changed files with 198 additions and 302 deletions

View File

@@ -19,6 +19,19 @@ export default class ImportNotionTask extends ImportTask {
if (!tree) {
throw new Error("Could not find valid content in zip file");
}
// New Notion exports have a single folder with the name of the export, we must skip this
// folder and go directly to the children.
if (
tree.children.length === 1 &&
tree.children[0].children.find((child) => child.title === "index")
) {
return this.parseFileTree(
fileOperation,
tree.children[0].children.filter((child) => child.title !== "index")
);
}
return this.parseFileTree(fileOperation, tree.children);
}