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) { function getNoteId(noteMeta, filePath) {
let noteId; let noteId;
if (noteMeta) { const filePathNoExt = getTextFileWithoutExtension(filePath);
noteId = getNewNoteId(noteMeta.noteId);
createdPaths[filePath] = noteId; if (noteMeta) {
if (filePathNoExt in createdPaths) {
noteId = createdPaths[filePathNoExt];
noteIdMap[noteMeta.noteId] = noteId;
}
else {
noteId = getNewNoteId(noteMeta.noteId);
}
} }
else { else {
const filePathNoExt = getTextFileWithoutExtension(filePath);
if (filePathNoExt in createdPaths) { if (filePathNoExt in createdPaths) {
noteId = createdPaths[filePathNoExt]; noteId = createdPaths[filePathNoExt];
} }
else { else {
noteId = utils.newEntityId(); noteId = utils.newEntityId();
} }
createdPaths[filePathNoExt] = noteId;
} }
createdPaths[filePathNoExt] = noteId;
return noteId; return noteId;
} }