mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
new "disable_inclusion" attribute
This commit is contained in:
parent
5c91e38dfe
commit
1c6fc9029f
@ -47,6 +47,13 @@ class Note extends Entity {
|
||||
return map;
|
||||
}
|
||||
|
||||
async hasAttribute(name) {
|
||||
const map = await this.getAttributeMap();
|
||||
|
||||
return map.hasOwnProperty(name);
|
||||
}
|
||||
|
||||
// WARNING: this doesn't take into account the possibility to have multi-valued attributes!
|
||||
async getAttribute(name) {
|
||||
return this.repository.getEntity("SELECT * FROM attributes WHERE noteId = ? AND name = ?", [this.noteId, name]);
|
||||
}
|
||||
|
@ -12,7 +12,8 @@ const BUILTIN_ATTRIBUTES = [
|
||||
'hide_in_autocomplete',
|
||||
'exclude_from_export',
|
||||
'run',
|
||||
'manual_transaction_handling'
|
||||
'manual_transaction_handling',
|
||||
'disable_inclusion'
|
||||
];
|
||||
|
||||
async function getNoteAttributeMap(noteId) {
|
||||
|
@ -19,7 +19,7 @@ async function runNotesWithAttribute(runAttrValue) {
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(() => runNotesWithAttribute('backend_startup'), 1 * 1000);
|
||||
setTimeout(() => runNotesWithAttribute('backend_startup'), 10 * 1000);
|
||||
|
||||
setInterval(() => runNotesWithAttribute('hourly'), 3600 * 1000);
|
||||
|
||||
|
@ -61,6 +61,10 @@ async function getScriptBundle(note, includedNoteIds = []) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (await note.hasAttribute('disable_inclusion')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const bundle = {
|
||||
note: note,
|
||||
script: '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user