mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
image sync fixes and 4.0.0 electron
This commit is contained in:
@@ -252,7 +252,10 @@ async function getEntityRow(entityName, entityId) {
|
||||
|
||||
const entity = await sql.getRow(`SELECT * FROM ${entityName} WHERE ${primaryKey} = ?`, [entityId]);
|
||||
|
||||
if (entityName === 'notes' && (entity.type === 'file' || entity.type === 'image')) {
|
||||
if (entityName === 'notes'
|
||||
&& entity.content !== null
|
||||
&& (entity.type === 'file' || entity.type === 'image')) {
|
||||
|
||||
entity.content = entity.content.toString("binary");
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,13 @@ async function get(name) {
|
||||
|
||||
module.exports = {
|
||||
getSyncServerHost: async () => await get('syncServerHost'),
|
||||
isSyncSetup: async () => !!await get('syncServerHost'),
|
||||
isSyncSetup: async () => {
|
||||
const syncServerHost = await get('syncServerHost');
|
||||
|
||||
// special value "disabled" is here to support use case where document is configured with sync server
|
||||
// and we need to override it with config from config.ini
|
||||
return !!syncServerHost && syncServerHost !== 'disabled';
|
||||
},
|
||||
getSyncTimeout: async () => parseInt(await get('syncServerTimeout')),
|
||||
getSyncProxy: async () => await get('syncProxy')
|
||||
};
|
||||
@@ -39,7 +39,7 @@ async function updateEntity(sync, entity, sourceId) {
|
||||
}
|
||||
|
||||
function deserializeNoteContentBuffer(note) {
|
||||
if (note.type === 'file' || note.type === 'image') {
|
||||
if (note.content !== null && (note.type === 'file' || note.type === 'image')) {
|
||||
note.content = new Buffer(note.content, 'binary');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user