mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-10-12 01:24:27 +08:00
Fix inability to set some options
This commit is contained in:
Generated
+1
-1
@@ -1085,7 +1085,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ew"
|
||||
version = "1.1.0"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"actix-multipart",
|
||||
"actix-web",
|
||||
|
||||
@@ -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"
|
||||
|
||||
+16
-4
@@ -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;
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user