fix(config): create apps.json from default after loading file_apps cfg (#4568)

This commit is contained in:
Andrew Marshall
2026-01-16 14:47:05 -05:00
committed by GitHub
parent cf7b0dc7d3
commit 8294ab23c1

View File

@ -1042,18 +1042,6 @@ namespace config {
}
void apply_config(std::unordered_map<std::string, std::string> &&vars) {
#ifndef __ANDROID__
// TODO: Android can possibly support this
if (!fs::exists(stream.file_apps.c_str())) {
fs::copy_file(SUNSHINE_ASSETS_DIR "/apps.json", stream.file_apps);
fs::permissions(
stream.file_apps,
fs::perms::owner_read | fs::perms::owner_write,
fs::perm_options::add
);
}
#endif
for (auto &[name, val] : vars) {
BOOST_LOG(info) << "config: '"sv << name << "' = "sv << val;
modified_config_settings[name] = val;
@ -1187,6 +1175,18 @@ namespace config {
int_between_f(vars, "wan_encryption_mode", stream.wan_encryption_mode, {0, 2});
path_f(vars, "file_apps", stream.file_apps);
#ifndef __ANDROID__
// TODO: Android can possibly support this
if (!fs::exists(stream.file_apps.c_str())) {
fs::copy_file(SUNSHINE_ASSETS_DIR "/apps.json", stream.file_apps);
fs::permissions(
stream.file_apps,
fs::perms::owner_read | fs::perms::owner_write,
fs::perm_options::add
);
}
#endif
int_between_f(vars, "fec_percentage", stream.fec_percentage, {1, 255});
map_int_int_f(vars, "keybindings"s, input.keybindings);