mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	tar file export now sets mtime to tar records based on utcDateCreated of a note, closes #487
This commit is contained in:
		| @@ -2,6 +2,7 @@ | ||||
|  | ||||
| const html = require('html'); | ||||
| const repository = require('../repository'); | ||||
| const dateUtils = require('../date_utils'); | ||||
| const tar = require('tar-stream'); | ||||
| const path = require('path'); | ||||
| const mimeTypes = require('mime-types'); | ||||
| @@ -270,7 +271,11 @@ ${content} | ||||
|         if (noteMeta.dataFileName) { | ||||
|             const content = prepareContent(noteMeta.title, await note.getContent(), noteMeta); | ||||
|  | ||||
|             pack.entry({name: filePathPrefix + noteMeta.dataFileName, size: content.length}, content); | ||||
|             pack.entry({ | ||||
|                 name: filePathPrefix + noteMeta.dataFileName, | ||||
|                 size: content.length, | ||||
|                 mtime: dateUtils.parseDateTime(note.utcDateModified) | ||||
|             }, content); | ||||
|         } | ||||
|  | ||||
|         taskContext.increaseProgressCount(); | ||||
| @@ -278,7 +283,11 @@ ${content} | ||||
|         if (noteMeta.children && noteMeta.children.length > 0) { | ||||
|             const directoryPath = filePathPrefix + noteMeta.dirFileName; | ||||
|  | ||||
|             pack.entry({name: directoryPath, type: 'directory'}); | ||||
|             pack.entry({ | ||||
|                 name: directoryPath, | ||||
|                 type: 'directory', | ||||
|                 mtime: dateUtils.parseDateTime(note.utcDateModified) | ||||
|             }); | ||||
|  | ||||
|             for (const childMeta of noteMeta.children) { | ||||
|                 await saveNote(childMeta, directoryPath + '/'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user