Skip to content

Build your personal knowledge base with Trilium Notes

updated demo document based on changes in tar format

zadamae8a2bfb1b84
diff --git a/db/demo.tar b/db/demo.tar
index 4edf706364..599f8a0b98 100644
Binary files a/db/demo.tar and b/db/demo.tar differ
diff --git a/src/services/import/tar.js b/src/services/import/tar.js
index 64a70e0b7a..899fc5065b 100644
--- a/src/services/import/tar.js
+++ b/src/services/import/tar.js
@@ -115,24 +115,28 @@ async function importTar(importContext, fileBuffer, importRootNote) {
function getNoteId(noteMeta, filePath) {
let noteId;
- if (noteMeta) {
- noteId = getNewNoteId(noteMeta.noteId);
+ const filePathNoExt = getTextFileWithoutExtension(filePath);
- createdPaths[filePath] = noteId;
+ if (noteMeta) {
+ if (filePathNoExt in createdPaths) {
+ noteId = createdPaths[filePathNoExt];
+ noteIdMap[noteMeta.noteId] = noteId;
+ }
+ else {
+ noteId = getNewNoteId(noteMeta.noteId);
+ }
}
else {
- const filePathNoExt = getTextFileWithoutExtension(filePath);
-
if (filePathNoExt in createdPaths) {
noteId = createdPaths[filePathNoExt];
}
else {
noteId = utils.newEntityId();
}
-
- createdPaths[filePathNoExt] = noteId;
}
+ createdPaths[filePathNoExt] = noteId;
+
return noteId;
}