mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Update filesystemadaptor to use a metafile for all binary files
Previously, newly created image files would end up being saved as a base64-encoded .tid file. Now they are saved as an ordinary binary file with an accompanying .meta file for the metadata.
This commit is contained in:
parent
e2d63a03b2
commit
dc020276b0
@ -121,9 +121,9 @@ FileSystemAdaptor.prototype.saveTiddler = function(tiddler,callback) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
if(fileInfo.hasMetaFile) {
|
||||
var typeInfo = $tw.config.contentTypeInfo[fileInfo.type];
|
||||
if(fileInfo.hasMetaFile || typeInfo.encoding === "base64") {
|
||||
// Save the tiddler as a separate body and meta file
|
||||
var typeInfo = $tw.config.contentTypeInfo[fileInfo.type];
|
||||
fs.writeFile(fileInfo.filepath,tiddler.fields.text,{encoding: typeInfo.encoding},function(err) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
|
Loading…
Reference in New Issue
Block a user