mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	added versioning to the metadata files in export tars
This commit is contained in:
		| @@ -64,6 +64,7 @@ async function exportNote(noteTreeId, directory, pack, repo) { | |||||||
|  |  | ||||||
| async function getMetadata(note) { | async function getMetadata(note) { | ||||||
|     return { |     return { | ||||||
|  |         version: 1, | ||||||
|         title: note.title, |         title: note.title, | ||||||
|         type: note.type, |         type: note.type, | ||||||
|         mime: note.mime, |         mime: note.mime, | ||||||
|   | |||||||
| @@ -112,6 +112,10 @@ router.post('/:parentNoteId', auth.checkApiAuthOrElectron, multer.single('upload | |||||||
|  |  | ||||||
| async function importNotes(files, parentNoteId, sourceId) { | async function importNotes(files, parentNoteId, sourceId) { | ||||||
|     for (const file of files) { |     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') { |         if (file.meta.type !== 'file') { | ||||||
|             file.data = file.data.toString("UTF-8"); |             file.data = file.data.toString("UTF-8"); | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user