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.
This commit is contained in:
tt2468 2024-07-17 22:57:41 -07:00
parent 7e3f2a82f0
commit 6c9fd55c63

View File

@ -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!");
}