refactor(config): rename EJS_AUTO_SAVE_SYNC to EJS_ENABLE_AUTO_SAVE_SYNC

The config.yml key (emulatorjs.auto_save_sync) is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Georges-Antoine Assi
2026-09-07 11:08:02 -04:00
parent 1443f66cf5
commit 7b2baaa545
7 changed files with 12 additions and 12 deletions

View File

@@ -251,7 +251,7 @@ class Config:
EJS_CACHE_LIMIT: int | None
EJS_DISABLE_AUTO_UNLOAD: bool
EJS_DISABLE_BATCH_BOOTUP: bool
EJS_AUTO_SAVE_SYNC: bool
EJS_ENABLE_AUTO_SAVE_SYNC: bool
EJS_NETPLAY_ENABLED: bool
EJS_NETPLAY_ICE_SERVERS: list[NetplayICEServer]
EJS_SETTINGS: dict[str, EjsOption] # core_name -> EjsOption
@@ -518,7 +518,7 @@ class ConfigManager:
EJS_DISABLE_BATCH_BOOTUP=pydash.get(
self._raw_config, "emulatorjs.disable_batch_bootup", False
),
EJS_AUTO_SAVE_SYNC=pydash.get(
EJS_ENABLE_AUTO_SAVE_SYNC=pydash.get(
self._raw_config, "emulatorjs.auto_save_sync", False
),
EJS_NETPLAY_ENABLED=pydash.get(
@@ -778,7 +778,7 @@ class ConfigManager:
)
sys.exit(3)
if not isinstance(self.config.EJS_AUTO_SAVE_SYNC, bool):
if not isinstance(self.config.EJS_ENABLE_AUTO_SAVE_SYNC, bool):
log.critical(
"Invalid config.yml: emulatorjs.auto_save_sync must be a boolean"
)
@@ -994,7 +994,7 @@ class ConfigManager:
"cache_limit": self.config.EJS_CACHE_LIMIT,
"disable_auto_unload": self.config.EJS_DISABLE_AUTO_UNLOAD,
"disable_batch_bootup": self.config.EJS_DISABLE_BATCH_BOOTUP,
"auto_save_sync": self.config.EJS_AUTO_SAVE_SYNC,
"auto_save_sync": self.config.EJS_ENABLE_AUTO_SAVE_SYNC,
"netplay": {
"enabled": self.config.EJS_NETPLAY_ENABLED,
"ice_servers": self.config.EJS_NETPLAY_ICE_SERVERS,

View File

@@ -136,7 +136,7 @@ def get_config(request: Request) -> ConfigResponse:
EJS_CACHE_LIMIT=cfg.EJS_CACHE_LIMIT,
EJS_DISABLE_AUTO_UNLOAD=cfg.EJS_DISABLE_AUTO_UNLOAD,
EJS_DISABLE_BATCH_BOOTUP=cfg.EJS_DISABLE_BATCH_BOOTUP,
EJS_AUTO_SAVE_SYNC=cfg.EJS_AUTO_SAVE_SYNC,
EJS_ENABLE_AUTO_SAVE_SYNC=cfg.EJS_ENABLE_AUTO_SAVE_SYNC,
EJS_NETPLAY_ENABLED=cfg.EJS_NETPLAY_ENABLED,
# Contains credentials, so only send when authenticated
EJS_NETPLAY_ICE_SERVERS=(

View File

@@ -24,7 +24,7 @@ class ConfigResponse(TypedDict):
EJS_CACHE_LIMIT: int | None
EJS_DISABLE_AUTO_UNLOAD: bool
EJS_DISABLE_BATCH_BOOTUP: bool
EJS_AUTO_SAVE_SYNC: bool
EJS_ENABLE_AUTO_SAVE_SYNC: bool
EJS_NETPLAY_ENABLED: bool
EJS_NETPLAY_ICE_SERVERS: list[NetplayICEServer]
EJS_SETTINGS: dict[str, dict[str, str]]

View File

@@ -57,7 +57,7 @@ def test_config_loader():
assert loader.config.EJS_DEBUG
assert loader.config.EJS_DISABLE_AUTO_UNLOAD
assert loader.config.EJS_DISABLE_BATCH_BOOTUP
assert loader.config.EJS_AUTO_SAVE_SYNC
assert loader.config.EJS_ENABLE_AUTO_SAVE_SYNC
assert loader.config.EJS_CACHE_LIMIT == 1000
assert loader.config.EJS_NETPLAY_ENABLED
assert loader.config.EJS_NETPLAY_ICE_SERVERS == [
@@ -132,7 +132,7 @@ def test_empty_config_loader():
assert loader.config.EJS_CACHE_LIMIT is None
assert not loader.config.EJS_DISABLE_AUTO_UNLOAD
assert not loader.config.EJS_DISABLE_BATCH_BOOTUP
assert not loader.config.EJS_AUTO_SAVE_SYNC
assert not loader.config.EJS_ENABLE_AUTO_SAVE_SYNC
assert not loader.config.EJS_NETPLAY_ENABLED
assert loader.config.EJS_NETPLAY_ICE_SERVERS == []
assert loader.config.EJS_SETTINGS == {}

View File

@@ -26,7 +26,7 @@ export type ConfigResponse = {
EJS_CACHE_LIMIT: (number | null);
EJS_DISABLE_AUTO_UNLOAD: boolean;
EJS_DISABLE_BATCH_BOOTUP: boolean;
EJS_AUTO_SAVE_SYNC: boolean;
EJS_ENABLE_AUTO_SAVE_SYNC: boolean;
EJS_NETPLAY_ENABLED: boolean;
EJS_NETPLAY_ICE_SERVERS: Array<NetplayICEServer>;
EJS_SETTINGS: Record<string, Record<string, string>>;

View File

@@ -33,7 +33,7 @@ const defaultConfig = {
EJS_CACHE_LIMIT: null,
EJS_DISABLE_AUTO_UNLOAD: false,
EJS_DISABLE_BATCH_BOOTUP: false,
EJS_AUTO_SAVE_SYNC: false,
EJS_ENABLE_AUTO_SAVE_SYNC: false,
EJS_NETPLAY_ICE_SERVERS: [],
EJS_SETTINGS: {},
EJS_CONTROLS: {},

View File

@@ -183,7 +183,7 @@ const {
EJS_DISABLE_BATCH_BOOTUP,
EJS_NETPLAY_ICE_SERVERS,
EJS_NETPLAY_ENABLED,
EJS_AUTO_SAVE_SYNC,
EJS_ENABLE_AUTO_SAVE_SYNC,
} = configStore.config;
// Full origin (with scheme)
window.EJS_netplayServer = EJS_NETPLAY_ENABLED ? window.location.origin : "";
@@ -489,7 +489,7 @@ window.EJS_onGameStart = async () => {
} else if (props.save) {
await loadSave(props.save);
}
if (EJS_AUTO_SAVE_SYNC) {
if (EJS_ENABLE_AUTO_SAVE_SYNC) {
await installAutoSaveSync().catch((error) =>
console.error("Failed to enable periodic save sync", error),
);