mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix broken image sync
This commit is contained in:
parent
321d0e8d64
commit
14bd5d301d
@ -252,12 +252,9 @@ async function getEntityRow(entityName, entityId) {
|
||||
|
||||
const entity = await sql.getRow(`SELECT * FROM ${entityName} WHERE ${primaryKey} = ?`, [entityId]);
|
||||
|
||||
if (entityName === 'notes' && entity.type === 'file') {
|
||||
if (entityName === 'notes' && (entity.type === 'file' || entity.type === 'image')) {
|
||||
entity.content = entity.content.toString("binary");
|
||||
}
|
||||
else if (entityName === 'images') {
|
||||
entity.data = entity.data.toString('base64');
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ async function updateEntity(sync, entity, sourceId) {
|
||||
}
|
||||
|
||||
function deserializeNoteContentBuffer(note) {
|
||||
if (note.type === 'file') {
|
||||
if (note.type === 'file' || note.type === 'image') {
|
||||
note.content = new Buffer(note.content, 'binary');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user