feat: filter:settings.get plugin hook

v1.18.x
Julian Lam 4 years ago
parent 3ea1aa4780
commit c7d15dfa94

@ -8,7 +8,7 @@ const pubsub = require('../pubsub');
const Settings = module.exports; const Settings = module.exports;
Settings.get = async function (hash) { Settings.get = async function (hash) {
const data = await db.getObject('settings:' + hash) || {}; let data = await db.getObject('settings:' + hash) || {};
const sortedLists = await db.getSetMembers('settings:' + hash + ':sorted-lists'); const sortedLists = await db.getSetMembers('settings:' + hash + ':sorted-lists');
await Promise.all(sortedLists.map(async function (list) { await Promise.all(sortedLists.map(async function (list) {
@ -26,6 +26,7 @@ Settings.get = async function (hash) {
}); });
})); }));
({ values: data } = await plugins.fireHook('filter:settings.get', { plugin: hash, values: data }));
return data; return data;
}; };

Loading…
Cancel
Save