mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-10 20:09:57 +00:00
Adds 'created' field to attachment meta.json file (#8356)
This commit is contained in:
parent
f1d0e52ff7
commit
39b7a4fb71
@ -69,6 +69,7 @@ AttachmentStore.prototype.saveAttachment = function(options) {
|
||||
fs.writeFileSync(path.resolve(attachmentPath,dataFilename),options.text,contentTypeInfo.encoding);
|
||||
// Save the meta.json file
|
||||
fs.writeFileSync(path.resolve(attachmentPath,"meta.json"),JSON.stringify({
|
||||
created: $tw.utils.stringifyDate(new Date()),
|
||||
modified: $tw.utils.stringifyDate(new Date()),
|
||||
contentHash: contentHash,
|
||||
filename: dataFilename,
|
||||
@ -94,6 +95,7 @@ AttachmentStore.prototype.adoptAttachment = function(incomingFilepath,type,hash)
|
||||
fs.renameSync(incomingFilepath,dataFilepath);
|
||||
// Save the meta.json file
|
||||
fs.writeFileSync(path.resolve(attachmentPath,"meta.json"),JSON.stringify({
|
||||
created: $tw.utils.stringifyDate(new Date()),
|
||||
modified: $tw.utils.stringifyDate(new Date()),
|
||||
contentHash: hash,
|
||||
filename: dataFilename,
|
||||
@ -137,4 +139,4 @@ AttachmentStore.prototype.getAttachmentStream = function(attachment_name) {
|
||||
|
||||
exports.AttachmentStore = AttachmentStore;
|
||||
|
||||
})();
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user