1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-29 13:52:03 +01:00

fix: automod WIP

This commit is contained in:
aclist 2024-01-24 21:56:47 +09:00
parent 04cb132219
commit 2f9c74e13b
3 changed files with 11 additions and 16 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -o pipefail set -o pipefail
version=5.0.0.rc-29 version=5.0.0.rc-30
#CONSTANTS #CONSTANTS
aid=221100 aid=221100
@ -536,10 +536,10 @@ fetch_dzq(){
fetch_helpers_by_sum(){ fetch_helpers_by_sum(){
declare -A sums declare -A sums
sums=( sums=(
["ui.py"]="12fac5997612367c0716f8575046ac6d" ["ui.py"]="ad04fee7066d5fe30fb39e875ff870d2"
["query_v2.py"]="1822bd1769ce7d7cb0d686a60f9fa197" ["query_v2.py"]="1822bd1769ce7d7cb0d686a60f9fa197"
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
["funcs"]="d2afc23090f4f1e670ac8eb1a5412579" ["funcs"]="26a4200acd85c0e0fc71a7fe57b1e13e"
) )
local author="aclist" local author="aclist"
local repo="dztui" local repo="dztui"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -o pipefail set -o pipefail
version=5.0.0.rc-29 version=5.0.0.rc-30
#CONSTANTS #CONSTANTS
aid=221100 aid=221100
@ -1080,7 +1080,7 @@ auto_mod_install(){
echo "# Downloaded $(($total-missing)) of $total mods. ESC cancels" echo "# Downloaded $(($total-missing)) of $total mods. ESC cancels"
done | $steamsafe_zenity --pulsate --progress --title="DZG Watcher" --auto-close --no-cancel --width=500 2>/dev/null done | $steamsafe_zenity --pulsate --progress --title="DZG Watcher" --auto-close --no-cancel --width=500 2>/dev/null
if [[ ! $? -eq 0 ]]; then if [[ ! $? -eq 0 ]]; then
echo "User canceled connect process. Steam may have mods pending for download." echo "User aborted connect process. Steam may have mods pending for download."
exit 1 exit 1
fi fi
@ -1103,7 +1103,8 @@ force_update(){
local update=$(check_timestamps) local update=$(check_timestamps)
console_dl "$update" && console_dl "$update" &&
$steam_cmd steam://open/downloads $steam_cmd steam://open/downloads
return 8 echo "Finished requesting mod updates. Steam may have some mods pending for download."
return 0
} }
console_dl(){ console_dl(){
readarray -t modids <<< "$@" readarray -t modids <<< "$@"

View file

@ -16,7 +16,7 @@ locale.setlocale(locale.LC_ALL, '')
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib, Gdk, GObject, Pango from gi.repository import Gtk, GLib, Gdk, GObject, Pango
# 5.0.0-rc.29 # 5.0.0-rc.30
app_name = "DZGUI" app_name = "DZGUI"
cache = {} cache = {}
@ -283,13 +283,11 @@ def process_shell_return_code(transient_parent, msg, code, original_input):
case 0: case 0:
# success with notice popup # success with notice popup
spawn_dialog(transient_parent, msg, "NOTIFY") spawn_dialog(transient_parent, msg, "NOTIFY")
pass
case 1: case 1:
# error with notice popup # error with notice popup
if msg == "": if msg == "":
msg = "Something went wrong" msg = "Something went wrong"
spawn_dialog(transient_parent, msg, "NOTIFY") spawn_dialog(transient_parent, msg, "NOTIFY")
pass
case 2: case 2:
# warn and recurse (e.g. validation failed) # warn and recurse (e.g. validation failed)
spawn_dialog(transient_parent, msg, "NOTIFY") spawn_dialog(transient_parent, msg, "NOTIFY")
@ -308,12 +306,6 @@ def process_shell_return_code(transient_parent, msg, code, original_input):
case 6: case 6:
# return silently # return silently
pass pass
case 7:
msg = "Some mods may have failed to download. Try connecting again to resync."
spawn_dialog(transient_parent, msg, "NOTIFY")
case 8:
msg = "Finished requesting mod updates. Steam may have mods pending for download."
spawn_dialog(transient_parent, msg, "NOTIFY")
case 90: case 90:
# used to update configs and metadata in-place # used to update configs and metadata in-place
treeview = transient_parent.grid.scrollable_treelist.treeview treeview = transient_parent.grid.scrollable_treelist.treeview
@ -1010,7 +1002,9 @@ class TreeView(Gtk.TreeView):
def load(): def load():
dialog.destroy() dialog.destroy()
transient = self.get_outer_window() transient = self.get_outer_window()
process_shell_return_code(transient, proc.stdout, proc.returncode, record) out = proc.stdout.splitlines()
msg = out[-1]
process_shell_return_code(transient, msg, proc.returncode, record)
proc = call_out(self, "Connect from table", record) proc = call_out(self, "Connect from table", record)
GLib.idle_add(load) GLib.idle_add(load)