mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
relation between notes and images
This commit is contained in:
@@ -110,6 +110,20 @@ async function updateImage(entity, sourceId) {
|
||||
}
|
||||
}
|
||||
|
||||
async function updateNoteImage(entity, sourceId) {
|
||||
const origNoteImage = await sql.getFirst("SELECT * FROM notes_image WHERE note_image_id = ?", [entity.note_image_id]);
|
||||
|
||||
if (!origNoteImage || origNoteImage.date_modified <= entity.date_modified) {
|
||||
await sql.doInTransaction(async () => {
|
||||
await sql.replace("notes_image", entity);
|
||||
|
||||
await sync_table.addNoteImageSync(entity.note_image_id, sourceId);
|
||||
});
|
||||
|
||||
log.info("Update/sync note image " + entity.note_image_id);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
updateNote,
|
||||
updateNoteTree,
|
||||
@@ -117,5 +131,6 @@ module.exports = {
|
||||
updateNoteReordering,
|
||||
updateOptions,
|
||||
updateRecentNotes,
|
||||
updateImage
|
||||
updateImage,
|
||||
updateNoteImage
|
||||
};
|
||||
Reference in New Issue
Block a user