mirror of
https://github.com/aclist/dztui.git
synced 2025-01-01 15:12:05 +01:00
fix: align local mod signatures
This commit is contained in:
parent
1b7752588c
commit
732bc918a7
2 changed files with 26 additions and 3 deletions
17
dzgui.sh
17
dzgui.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
version=5.6.0-beta.1
|
version=5.6.0-beta.2
|
||||||
|
|
||||||
#CONSTANTS
|
#CONSTANTS
|
||||||
aid=221100
|
aid=221100
|
||||||
|
@ -572,7 +572,7 @@ fetch_helpers_by_sum(){
|
||||||
["ui.py"]="680ff0e4071681f26409fa3592a41e46"
|
["ui.py"]="680ff0e4071681f26409fa3592a41e46"
|
||||||
["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
|
["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
|
||||||
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
|
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
|
||||||
["funcs"]="fa5eb43c454e6bf2903e94884fe64644"
|
["funcs"]="acd5d85b27141082b25e07138f8b5b54"
|
||||||
["lan"]="c62e84ddd1457b71a85ad21da662b9af"
|
["lan"]="c62e84ddd1457b71a85ad21da662b9af"
|
||||||
)
|
)
|
||||||
local author="aclist"
|
local author="aclist"
|
||||||
|
@ -862,6 +862,18 @@ legacy_cols(){
|
||||||
< $cols_file jq '.cols += { "Queue": 120 }' > $cols_file.new &&
|
< $cols_file jq '.cols += { "Queue": 120 }' > $cols_file.new &&
|
||||||
mv $cols_file.new $cols_file
|
mv $cols_file.new $cols_file
|
||||||
}
|
}
|
||||||
|
stale_mod_signatures(){
|
||||||
|
local workshop_dir="$steam_path/steamapps/workshop/content/$aid"
|
||||||
|
if [[ -d $workshop_dir ]]; then
|
||||||
|
readarray -t old_mod_ids < <(awk -F, '{print $1}' $versions_file)
|
||||||
|
for ((i=0; i<${#old_mod_ids[@]}; ++i)); do
|
||||||
|
if [[ ! -d $workshop_dir/${old_mod_ids[$i]} ]]; then
|
||||||
|
"$HOME/.local/share/$app_name/helpers/funcs" "align_local" "${old_mod_ids[$i]}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
initial_setup(){
|
initial_setup(){
|
||||||
setup_dirs
|
setup_dirs
|
||||||
setup_state_files
|
setup_state_files
|
||||||
|
@ -882,6 +894,7 @@ initial_setup(){
|
||||||
steam_deps
|
steam_deps
|
||||||
migrate_files
|
migrate_files
|
||||||
stale_symlinks
|
stale_symlinks
|
||||||
|
stale_mod_signatures
|
||||||
local_latlon
|
local_latlon
|
||||||
is_steam_running
|
is_steam_running
|
||||||
is_dzg_downloading
|
is_dzg_downloading
|
||||||
|
|
|
@ -117,6 +117,7 @@ declare -A funcs=(
|
||||||
["start_cooldown"]="start_cooldown"
|
["start_cooldown"]="start_cooldown"
|
||||||
["list_mods"]="list_mods"
|
["list_mods"]="list_mods"
|
||||||
["delete"]="delete_local_mod"
|
["delete"]="delete_local_mod"
|
||||||
|
["align_local"]="align_versions_file"
|
||||||
["show_server_modlist"]="show_server_modlist"
|
["show_server_modlist"]="show_server_modlist"
|
||||||
["test_ping"]="test_ping"
|
["test_ping"]="test_ping"
|
||||||
["is_in_favs"]="is_in_favs"
|
["is_in_favs"]="is_in_favs"
|
||||||
|
@ -339,7 +340,7 @@ list_mods(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
installed_mods(){
|
installed_mods(){
|
||||||
ls -1 "$workshop_dir"
|
find "$workshop_dir" -maxdepth 1 -mindepth 1 -printf "%f\n"
|
||||||
}
|
}
|
||||||
local_latlon(){
|
local_latlon(){
|
||||||
local url="http://ip-api.com/json/$local_ip"
|
local url="http://ip-api.com/json/$local_ip"
|
||||||
|
@ -579,6 +580,14 @@ parse_server_json(){
|
||||||
"\(.addr|split(":")[1])"
|
"\(.addr|split(":")[1])"
|
||||||
' | sort -k1
|
' | sort -k1
|
||||||
}
|
}
|
||||||
|
align_versions_file(){
|
||||||
|
shift
|
||||||
|
local mod="$1"
|
||||||
|
[[ ! -f $versions_file ]] && return
|
||||||
|
< "$versions_file" awk -F, -v var="$mod" '$1 != var' > $versions_file.new &&
|
||||||
|
mv $versions_file.new $versions_file
|
||||||
|
logger INFO "Removed local signatures for the mod '$mod'"
|
||||||
|
}
|
||||||
delete_local_mod(){
|
delete_local_mod(){
|
||||||
shift
|
shift
|
||||||
if [[ -z $1 ]]; then
|
if [[ -z $1 ]]; then
|
||||||
|
@ -597,6 +606,7 @@ delete_local_mod(){
|
||||||
[[ ! -L $game_dir/${symlinks[$i]} ]] && return 1
|
[[ ! -L $game_dir/${symlinks[$i]} ]] && return 1
|
||||||
#SC2115
|
#SC2115
|
||||||
rm -rf "${workshop_dir:?}/${ids[$i]}" && unlink "$game_dir/${symlinks[$i]}" || return 1
|
rm -rf "${workshop_dir:?}/${ids[$i]}" && unlink "$game_dir/${symlinks[$i]}" || return 1
|
||||||
|
align_versions_file "align" "${ids[$i]}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
test_cooldown(){
|
test_cooldown(){
|
||||||
|
|
Loading…
Reference in a new issue