Fix inability to set some options

This commit is contained in:
Ethan O'Brien
2026-09-27 14:26:59 -05:00
parent 8c58ff5b01
commit 78362608c8
3 changed files with 19 additions and 7 deletions
Generated
+1 -1
View File
@@ -1085,7 +1085,7 @@ dependencies = [
[[package]]
name = "ew"
version = "1.1.0"
version = "2.0.0"
dependencies = [
"actix-multipart",
"actix-web",
+1 -1
View File
@@ -32,7 +32,7 @@ services:
#EN_ANDROID_ASSET_HASH: ""
#EN_IOS_ASSET_HASH: ""
#WINDOWS_ASSET_HASH: "" # Windows asset hash (JP only; GL Windows is unused)
#FORCE_UPDATES: false # Force outdated clients to update
#FORCE_UPDATES: "true" # Force outdated clients to update
# Everything below is for the "Help" page
#ANDROID_GLOBAL: "link.to/patched/android/global.apk"
+17 -5
View File
@@ -254,11 +254,15 @@ pub fn overlay_args(args: &mut crate::options::Args) {
if cfg.arcade_session_ttl != 0 {
args.arcade_session_ttl = cfg.arcade_session_ttl;
}
args.owner = cfg.owner.clone();
args.hidden = cfg.hidden;
args.force_updates = cfg.force_updates;
args.disable_imports = cfg.disable_imports;
args.disable_exports = cfg.disable_exports;
// An embedding app may supply these options, but its default values must
// not erase flags passed by the standalone server (including Docker).
if !cfg.owner.is_empty() {
args.owner = cfg.owner.clone();
}
args.hidden |= cfg.hidden;
args.force_updates |= cfg.force_updates;
args.disable_imports |= cfg.disable_imports;
args.disable_exports |= cfg.disable_exports;
// Overlay only ever enables the features; a command-line --enable-custom-*
// flag is never overridden back to off
if cfg.enable_custom_songs {
@@ -330,4 +334,12 @@ fn android_host_config_updates_owner_and_feature_options() {
assert!(!reset.enable_custom_songs);
assert!(!reset.hidden);
assert!(!get_nerf_custom_cards());
let mut cli = crate::options::Args::parse_from([
"ew", "--force-updates", "--hidden", "--disable-imports",
"--disable-exports", "--owner", "123",
]);
overlay_args(&mut cli);
assert!(cli.force_updates && cli.hidden && cli.disable_imports && cli.disable_exports);
assert_eq!(cli.owner, vec![123]);
}