From 896cfa9a95aac38dfc67f2543c3756b25b028cac Mon Sep 17 00:00:00 2001 From: Ren Tatsumoto Date: Mon, 11 Jul 2022 13:01:07 +0300 Subject: [PATCH] convert config values from lua to mpv --- videoclip.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/videoclip.lua b/videoclip.lua index 29fff69..e508299 100644 --- a/videoclip.lua +++ b/videoclip.lua @@ -554,6 +554,13 @@ function pref_menu:update() end function pref_menu:save() + local function lua_to_mpv(config_value) + if type(config_value) == 'boolean' then + return config_value and 'yes' or 'no' + else + return config_value + end + end local ignore_list = { video_extension = true, audio_extension = true, @@ -567,7 +574,7 @@ function pref_menu:save() handle:write(string.format("# Written by %s on %s.\n", NAME, os.date())) for key, value in pairs(config) do if ignore_list[key] == nil then - handle:write(string.format('%s=%s\n', key, value)) + handle:write(string.format('%s=%s\n', key, lua_to_mpv(value))) end end handle:close()