mirror of
https://github.com/aclist/dztui.git
synced 2026-08-26 09:47:36 +02:00
chore: port changes from dzgui7 branch
This commit is contained in:
parent
38bfef3836
commit
43f6c17c4b
@ -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(
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user