mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-02-04 13:25:42 +00:00
fix(config): create apps.json from default after loading file_apps cfg (#4568)
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user