updated demo document based on changes in tar format

This commit is contained in:
zadam 2019-09-01 22:43:16 +02:00
parent 15a2fe2570
commit ae8a2bfb1b
2 changed files with 11 additions and 7 deletions

Binary file not shown.

View file

@ -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;
}