1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-28 05:12:36 +01:00

Compare commits

...

2 commits

Author SHA1 Message Date
aclist
aa9853af06
Merge 973e2dc100 into 99d964bf44 2024-12-19 10:41:55 +09:00
aclist
973e2dc100 fix: shorten symlink check time 2024-12-19 10:21:44 +09:00
3 changed files with 24 additions and 25 deletions

View file

@ -1,5 +1,11 @@
# Changelog # Changelog
## [5.6.0-beta.19] 2024-12-18
### Added
- Redact usernames in log files
### Fixed
- More performant symlink traversal when checking for legacy links
## [5.6.0-beta.18] 2024-12-14 ## [5.6.0-beta.18] 2024-12-14
### Added ### Added
- Open Steam workshop subscriptions dialog - Open Steam workshop subscriptions dialog

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -o pipefail set -o pipefail
version=5.6.0-beta.18 version=5.6.0-beta.19
#CONSTANTS #CONSTANTS
aid=221100 aid=221100
@ -587,7 +587,7 @@ fetch_helpers_by_sum(){
["ui.py"]="99544ccef6060125509c4b689a808a15" ["ui.py"]="99544ccef6060125509c4b689a808a15"
["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
["funcs"]="98261fdba4323f77c6dd610c1efc4d11" ["funcs"]="05f104fcdf27222f04046d41ec48d692"
["lan"]="c62e84ddd1457b71a85ad21da662b9af" ["lan"]="c62e84ddd1457b71a85ad21da662b9af"
) )
local author="aclist" local author="aclist"

View file

@ -1202,29 +1202,22 @@ compare(){
} }
legacy_symlinks(){ legacy_symlinks(){
logger INFO "Removing legacy symlinks" logger INFO "Removing legacy symlinks"
for d in "$game_dir"/*; do
if [[ $d =~ @[0-9]+-.+ ]]; then readarray -t stale_mod_dirs1 < <(find "$workshop_dir" -maxdepth 1 -mindepth 1 -type l -name '@?*-*')
logger INFO "Unlinking '$d'" logger INFO "Read local mods into array 1 with length: ${#stale_mod_dirs[@]}"
unlink "$d" if [[ ${#stale_mod_dirs1} -ne 0 ]]; then
fi for d in "${stale_mod_dirs1[@]}"; do
done unlink "$game_dir/$d"
readarray -t mod_dirs < <(find "$workshop_dir" -maxdepth 1 -mindepth 1 -type d) done
logger INFO "Read local mods into array with length: ${#mod_dirs[@]}" fi
[[ ${#mod_dirs[@]} -eq 0 ]] && return
logger INFO "Removing legacy encoding format" readarray -t stale_mod_dirs2 < <(find "$workshop_dir" -maxdepth 1 -mindepth 1 -type l -name '@??')
for d in "${mod_dirs[@]}"; do logger INFO "Read local mods into array 2 with length: ${#stale_mod_dirs[@]}"
# suppress errors if mods are downloading at boot if [[ ${#stale_mod_dirs2} -eq 0 ]]; then
logger INFO "Testing directory '$d'" for d in "${stale_mod_dirs2[@]}"; do
[[ ! -f "$d/meta.cpp" ]] && continue unlink "$game_dir/$d"
local id=$(awk -F"= " '/publishedid/ {print $2}' "$d"/meta.cpp | awk -F\; '{print $1}') done
logger INFO "Given id is '$id'" fi
local encoded_id=$(echo "$id" | awk '{printf("%c",$1)}' | base64 | sed 's/\//_/g; s/=//g; s/+/]/g')
logger INFO "Resolved id is '$encoded_id'"
if [[ -h "$game_dir/@$encoded_id" ]]; then
logger INFO "Unlinking '$game_dir/@$encoded_id'"
unlink "$game_dir/@$encoded_id"
fi
done
} }
symlinks(){ symlinks(){
readarray -t mod_dirs < <(find "$workshop_dir" -maxdepth 1 -mindepth 1 -type d) readarray -t mod_dirs < <(find "$workshop_dir" -maxdepth 1 -mindepth 1 -type d)