From 6c9fd55c634ef4cd66c15301e9f39309ce4e6521 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 17 Jul 2024 22:57:41 -0700 Subject: [PATCH] config: Always write config when migrating Fixes an issue where OBS 30.1.2 migrations would work on the first 30.2.0 load, but the settings would not persist to disk for further loads. --- src/Config.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Config.cpp b/src/Config.cpp index 84a5fbef..aaeb32c3 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -87,6 +87,10 @@ void Config::Load(json config) Save(); } + // If there are migrated settings, write them to disk before processing arguments. + if (!config.empty()) + Save(); + // Process `--websocket_port` override QString portArgument = Utils::Platform::GetCommandLineArgument(CMDLINE_WEBSOCKET_PORT); if (portArgument != "") { @@ -141,7 +145,9 @@ void Config::Save() config[PARAM_PASSWORD] = ServerPassword; } - if (!Utils::Json::SetJsonFileContent(configFilePath, config)) + if (Utils::Json::SetJsonFileContent(configFilePath, config)) + blog(LOG_DEBUG, "[Config::Save] Saved config."); + else blog(LOG_ERROR, "[Config::Save] Failed to write config file!"); }