1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2025-09-07 14:12:26 +02:00

feat: open workshop subscriptions

This commit is contained in:
aclist 2024-12-15 09:08:35 +09:00
parent e6b5e40bb2
commit 4d3d9bf0bb
4 changed files with 88 additions and 2 deletions

View file

@ -104,6 +104,7 @@ declare -A funcs=(
["Connect by IP"]="validate_and_connect"
["Connect by ID"]="validate_and_connect"
["Connect from table"]="connect_from_table"
["find_id"]="find_id"
["toggle"]="toggle"
["Open link"]="open_link"
["filter"]="dump_servers"
@ -121,6 +122,7 @@ declare -A funcs=(
["is_in_favs"]="is_in_favs"
["show_log"]="show_log"
["Output system info to log file"]="generate_log"
["open_user_workshop"]="open_user_workshop"
["open_workshop_page"]="open_workshop_page"
["Add to my servers"]="update_favs_from_table"
["Remove from my servers"]="update_favs_from_table"
@ -332,6 +334,19 @@ is_in_favs(){
done
return 1
}
find_id(){
local file="$default_steam_path/config/loginusers.vdf"
[[ ! -f $file ]] && return 1
local res=$(python3 $HOME/.local/share/dzgui/helpers/vdf2json.py \
-i "$file" | jq -r '.users
|to_entries[]
|select(.value.MostRecent=="1")
|.key'
)
[[ -z $res ]] && return 1
printf "%s" "$res"
return 0
}
list_mods(){
local symlink
local sep
@ -1051,6 +1066,12 @@ update_config_val(){
show_log(){
< "$debug_log" sed 's/Keyword␞/Keyword/'
}
open_user_workshop(){
shift
local id="$1"
url="https://steamcommunity.com/profiles/$id/myworkshopfiles/?appid=$aid&browsefilter=mysubscriptions"
$steam_cmd steam://openurl/$url &
}
open_workshop_page(){
shift
local id="$1"