From 43f6c17c4bb6f7fd7d2fd843b979d381b01b22fa Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Sun, 14 Jun 2026 22:02:21 +0900 Subject: [PATCH] chore: port changes from dzgui7 branch --- dzgui/api/steam.py | 11 +++-------- dzgui/managers/connection.py | 10 ++++++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dzgui/api/steam.py b/dzgui/api/steam.py index 6cecbf5..63ca05f 100644 --- a/dzgui/api/steam.py +++ b/dzgui/api/steam.py @@ -73,14 +73,9 @@ def get_local_signatures(version_file: Path) -> dict[str, int]: return hashes -def enqueue_mod(mod: str, appid: int) -> None: - args = [ - "steam", - f"steam://url/CommunityFilePage/{mod}+workshop_download_item", - str(appid), - mod, - ] - subprocess.Popen(["/usr/bin/env", "bash", *args]) +def enqueue_mod(client: str, mod: str, appid: int) -> None: + client_args = concat_bash_args(client) + subprocess.Popen([*client_args, "+workshop_download_item", str(appid), mod]) def get_needs_update( diff --git a/dzgui/managers/connection.py b/dzgui/managers/connection.py index d127dab..c0d092e 100644 --- a/dzgui/managers/connection.py +++ b/dzgui/managers/connection.py @@ -88,6 +88,7 @@ class ConnectionManager: self.record: Record self.workshop: Path + self.client: str self.remote_mod_ids: list[str] = [] self.missing_mods: list[tuple[str, str, int, int]] = [] @@ -171,6 +172,7 @@ class ConnectionManager: client = self.controller.query_config(Preferences.CLIENT) running = is_steam_running(client) steam_proc = SteamProcess(client_name, running) + self.client = client game_mode = prefs.is_game_mode @@ -263,11 +265,10 @@ class ConnectionManager: def _connect_steam(self, menu_only: bool) -> None: addr = f"{self.record.ip}:{self.record.gameport}" playername = self.controller.query_config(Preferences.NAME) - client = self.controller.query_config(Preferences.CLIENT) if menu_only: - rc = load_to_menu(client, self.appid, playername, self.remote_mod_ids) + rc = load_to_menu(self.client, self.appid, playername, self.remote_mod_ids) else: - rc = connect(client, addr, self.appid, playername, self.remote_mod_ids) + rc = connect(self.client, addr, self.appid, playername, self.remote_mod_ids) if rc != 0: # TODO: log/pop the error func = StoredFunc(self.controller.update_status) @@ -299,7 +300,8 @@ class ConnectionManager: for title, mod, stamp, size in self.missing_mods: if self.controller.is_cancel_pending(): return - enqueue_mod(mod, self.appid) + enqueue_mod(self.client, mod, self.appid) + # NOTE: prevents rate limiting time.sleep(3) if raise_window is True: