From c3454654c5389d6e3b6e8c2c98100c1a41b8d1b9 Mon Sep 17 00:00:00 2001 From: garret Date: Thu, 24 Nov 2022 00:16:48 +0000 Subject: depctrl global config: only pass config to functions instead of whole file --- macros/garret.depctrl_config.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'macros/garret.depctrl_config.lua') diff --git a/macros/garret.depctrl_config.lua b/macros/garret.depctrl_config.lua index 5d038c0..bda4a28 100644 --- a/macros/garret.depctrl_config.lua +++ b/macros/garret.depctrl_config.lua @@ -62,8 +62,7 @@ local function get_human_filesize(bytes) return bytes end -local function get_config(data) - local config = data.config +local function get_config(config) local defaults = {updaterEnabled = true, updateInterval = 302400, traceLevel = 3, extraFeeds = { }, tryAllFeeds = false, dumpFeeds = true, configDir = "?user/config", logMaxFiles = 200, logMaxAge = 604800, logMaxSize = 10 * (10 ^ 6), updateWaitTimeout = 60, updateOrphanTimeout = 600, logDir = "?user/log", writeLogs = true} local dialog = { { class="checkbox", name="updaterEnabled", @@ -178,7 +177,7 @@ end local function change_config(new) -- i think i might be thinning out the soup a bit too much local config_path = get_config_path() local data = read_json(config_path) - data.config = new(data) + data.config = new(data.config) write_json(config_path, data) end -- cgit v1.2.3-70-g09d2