mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
tar import will sort notes if there is no meta file
This commit is contained in:
@@ -14,6 +14,7 @@ const commonmark = require('commonmark');
|
||||
const ImportContext = require('../import_context');
|
||||
const protectedSessionService = require('../protected_session');
|
||||
const mimeService = require("./mime");
|
||||
const treeService = require("../tree");
|
||||
|
||||
/**
|
||||
* @param {ImportContext} importContext
|
||||
@@ -426,6 +427,12 @@ async function importTar(importContext, fileBuffer, importRootNote) {
|
||||
for (const noteId in createdNoteIds) { // now the noteIds are unique
|
||||
await noteService.scanForLinks(noteId);
|
||||
|
||||
if (!metaFile) {
|
||||
// if there's no meta file then the notes are created based on the order in that tar file but that
|
||||
// is usually quite random so we sort the notes in the way they would appear in the file manager
|
||||
await treeService.sortNotesAlphabetically(noteId, true);
|
||||
}
|
||||
|
||||
importContext.increaseProgressCount();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user