mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-21 01:53:20 +03:00
Fixed issue where config items that defaulted to false would not be created if they were missing
This commit is contained in:
@@ -97,13 +97,13 @@ function getConfigItem(key) {
|
|||||||
}
|
}
|
||||||
let path = CONFIG_ITEMS[key]['path'];
|
let path = CONFIG_ITEMS[key]['path'];
|
||||||
const val = Object.byString(config_json, path);
|
const val = Object.byString(config_json, path);
|
||||||
if (val === undefined && Object.byString(DEFAULT_CONFIG, path)) {
|
if (val === undefined && Object.byString(DEFAULT_CONFIG, path) !== undefined) {
|
||||||
logger.warn(`Cannot find config with key '${key}'. Creating one with the default value...`);
|
logger.warn(`Cannot find config with key '${key}'. Creating one with the default value...`);
|
||||||
setConfigItem(key, Object.byString(DEFAULT_CONFIG, path));
|
setConfigItem(key, Object.byString(DEFAULT_CONFIG, path));
|
||||||
return Object.byString(DEFAULT_CONFIG, path);
|
return Object.byString(DEFAULT_CONFIG, path);
|
||||||
}
|
}
|
||||||
return Object.byString(config_json, path);
|
return Object.byString(config_json, path);
|
||||||
};
|
}
|
||||||
|
|
||||||
function setConfigItem(key, value) {
|
function setConfigItem(key, value) {
|
||||||
let success = false;
|
let success = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user