mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 07:45:51 +01:00
fix attachment sync
This commit is contained in:
@@ -204,6 +204,8 @@ async function pushEntity(sync, syncContext) {
|
||||
|
||||
if (sync.entityName === 'notes') {
|
||||
entity = await sql.getRow('SELECT * FROM notes WHERE noteId = ?', [sync.entityId]);
|
||||
|
||||
serializeNoteContentBuffer(entity);
|
||||
}
|
||||
else if (sync.entityName === 'note_tree') {
|
||||
entity = await sql.getRow('SELECT * FROM note_tree WHERE noteTreeId = ?', [sync.entityId]);
|
||||
@@ -258,6 +260,12 @@ async function pushEntity(sync, syncContext) {
|
||||
await syncRequest(syncContext, 'PUT', '/api/sync/' + sync.entityName, payload);
|
||||
}
|
||||
|
||||
function serializeNoteContentBuffer(note) {
|
||||
if (note.type === 'file') {
|
||||
note.content = note.content.toString("binary");
|
||||
}
|
||||
}
|
||||
|
||||
async function checkContentHash(syncContext) {
|
||||
const resp = await syncRequest(syncContext, 'GET', '/api/sync/check');
|
||||
|
||||
@@ -350,5 +358,6 @@ sql.dbReady.then(() => {
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
sync
|
||||
sync,
|
||||
serializeNoteContentBuffer
|
||||
};
|
||||
Reference in New Issue
Block a user