mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
use new dynamic config
This commit is contained in:
@ -65,9 +65,8 @@ const sendError = (error) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = async (win_, options) => {
|
module.exports = async (win_) => {
|
||||||
win = win_;
|
win = win_;
|
||||||
config.init(options);
|
|
||||||
injectCSS(win.webContents, join(__dirname, 'style.css'));
|
injectCSS(win.webContents, join(__dirname, 'style.css'));
|
||||||
|
|
||||||
yt = await Innertube.create({
|
yt = await Innertube.create({
|
||||||
|
|||||||
@ -1,23 +1,3 @@
|
|||||||
const { setOptions, setMenuOptions } = require('../../config/plugins');
|
const { PluginConfig } = require('../../config/dynamic');
|
||||||
const defaultConfig = require('../../config/defaults');
|
const config = new PluginConfig('downloader');
|
||||||
|
module.exports = { ...config };
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user