mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-22 12:40:56 +03:00
Added ability to set config from settings
theme slide toggle is now in top right menu
This commit is contained in:
@@ -510,6 +510,20 @@ app.get('/api/config', function(req, res) {
|
||||
});
|
||||
});
|
||||
|
||||
app.post('/api/setConfig', function(req, res) {
|
||||
let new_config_file = req.body.new_config_file;
|
||||
if (new_config_file && new_config_file['YoutubeDLMaterial']) {
|
||||
let success = config_api.setConfigFile(new_config_file);
|
||||
res.send({
|
||||
success: success
|
||||
});
|
||||
} else {
|
||||
console.log('ERROR: Tried to save invalid config file!')
|
||||
res.sendStatus(400);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
app.get('/api/using-encryption', function(req, res) {
|
||||
res.send(usingEncryption);
|
||||
});
|
||||
|
||||
@@ -109,5 +109,6 @@ module.exports = {
|
||||
setConfigItem: setConfigItem,
|
||||
setConfigItems: setConfigItems,
|
||||
getConfigFile: getConfigFile,
|
||||
setConfigFile: setConfigFile,
|
||||
CONFIG_ITEMS: CONFIG_ITEMS
|
||||
}
|
||||
Reference in New Issue
Block a user