mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
added versioning to the metadata files in export tars
This commit is contained in:
parent
8c7d159012
commit
83d6c2970f
@ -64,6 +64,7 @@ async function exportNote(noteTreeId, directory, pack, repo) {
|
||||
|
||||
async function getMetadata(note) {
|
||||
return {
|
||||
version: 1,
|
||||
title: note.title,
|
||||
type: note.type,
|
||||
mime: note.mime,
|
||||
|
@ -112,6 +112,10 @@ router.post('/:parentNoteId', auth.checkApiAuthOrElectron, multer.single('upload
|
||||
|
||||
async function importNotes(files, parentNoteId, sourceId) {
|
||||
for (const file of files) {
|
||||
if (file.meta.version !== 1) {
|
||||
throw new Error("Can't read meta data version " + file.meta.version);
|
||||
}
|
||||
|
||||
if (file.meta.type !== 'file') {
|
||||
file.data = file.data.toString("UTF-8");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user