mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
cleaned up images and links which are not used nor supported
This commit is contained in:
@@ -6,21 +6,13 @@ const eventLog = require('./event_log');
|
||||
const notes = require('./notes');
|
||||
const sync_table = require('./sync_table');
|
||||
|
||||
async function updateNote(entity, links, sourceId) {
|
||||
async function updateNote(entity, sourceId) {
|
||||
const origNote = await sql.getSingleResult("SELECT * FROM notes WHERE note_id = ?", [entity.note_id]);
|
||||
|
||||
if (!origNote || origNote.date_modified <= entity.date_modified) {
|
||||
await sql.doInTransaction(async () => {
|
||||
await sql.replace("notes", entity);
|
||||
|
||||
await sql.remove("links", entity.note_id);
|
||||
|
||||
for (const link of links) {
|
||||
delete link['lnk_id'];
|
||||
|
||||
//await sql.insert('link', link);
|
||||
}
|
||||
|
||||
await sync_table.addNoteSync(entity.note_id, sourceId);
|
||||
await eventLog.addNoteEvent(entity.note_id, "Synced note <note>");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user