Skip to content

Commit

Permalink
config: Always write config when migrating
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tt2468 committed Jul 18, 2024
1 parent 7e3f2a8 commit 6c9fd55
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "") {
Expand Down Expand Up @@ -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!");
}

Expand Down

0 comments on commit 6c9fd55

Please sign in to comment.