use new dynamic config

This commit is contained in:
Araxeus
2023-03-19 21:02:23 +02:00
parent 605401166d
commit e8c3716106
2 changed files with 4 additions and 25 deletions

View File

@ -1,23 +1,3 @@
const { setOptions, setMenuOptions } = require('../../config/plugins');
const defaultConfig = require('../../config/defaults');
let config = defaultConfig.plugins['downloader'];
module.exports.init = (options) => {
config = { ...config, ...options };
};
module.exports.setAndMaybeRestart = (option, value) => {
config[option] = value;
setMenuOptions('downloader', config);
};
module.exports.set = (option, value) => {
config[option] = value;
setOptions('downloader', config);
};
module.exports.get = (option) => {
const res = config[option];
return res;
};
const { PluginConfig } = require('../../config/dynamic');
const config = new PluginConfig('downloader');
module.exports = { ...config };