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

Hotfix for small server lists

This commit is contained in:
aclist 2022-08-15 01:22:21 +09:00
parent a1b338c7ee
commit bb9a331e6d
3 changed files with 12 additions and 1 deletions

View file

@ -6,6 +6,10 @@
- Standardize dialogs - Standardize dialogs
- Query and connect by IP/port - Query and connect by IP/port
## [2.5.0-rc.2] 2022-08-14
### Fixed
- Hotfix for server list responses with no next page cursor breaking table
## [2.5.0-rc.1] 2022-08-14 ## [2.5.0-rc.1] 2022-08-14
### Changed ### Changed
- More performant path discovery, skip extraneous prompts - More performant path discovery, skip extraneous prompts

View file

@ -17,7 +17,7 @@ stable_url="https://raw.githubusercontent.com/aclist/dztui/dzgui/dzgui.sh"
testing_url="https://raw.githubusercontent.com/aclist/dztui/testing/dzgui.sh" testing_url="https://raw.githubusercontent.com/aclist/dztui/testing/dzgui.sh"
help_url="https://aclist.github.io/dzgui/dzgui" help_url="https://aclist.github.io/dzgui/dzgui"
check_config_msg="Check config values and restart." check_config_msg="Check config values and restart."
news_url="https://raw.githubusercontent.com/aclist/dztui/dzgui/news" news_url="https://raw.githubusercontent.com/aclist/dztui/testing/news"
freedesktop_path="$HOME/.local/share/applications" freedesktop_path="$HOME/.local/share/applications"
sd_install_path="$HOME/.local/share/dzgui" sd_install_path="$HOME/.local/share/dzgui"
@ -96,6 +96,7 @@ set_api_params(){
response=$(curl -s "$api" -H "Authorization: Bearer "$api_key"" -G -d "sort=-players" \ response=$(curl -s "$api" -H "Authorization: Bearer "$api_key"" -G -d "sort=-players" \
-d "filter[game]=$game" -d "filter[ids][whitelist]=$list_of_ids") -d "filter[game]=$game" -d "filter[ids][whitelist]=$list_of_ids")
list_response=$response list_response=$response
first_entry=1
} }
query_api(){ query_api(){
#TODO: prevent drawing list if null values returned without API error #TODO: prevent drawing list if null values returned without API error
@ -721,6 +722,11 @@ page_through(){
} }
parse_json(){ parse_json(){
page=$(echo "$list_response" | jq -r '.links.next?') page=$(echo "$list_response" | jq -r '.links.next?')
if [[ $first_entry -eq 1 ]]; then
list=$(echo "$list_response" | jq -r '.data[] .attributes | "\(.name)\t\(.ip):\(.port)\t\(.players)/\(.maxPlayers)\t\(.details.time)\t\(.status)\t\(.id)"')
idarr+=("$list")
first_entry=0
fi
if [[ "$page" != "null" ]]; then if [[ "$page" != "null" ]]; then
list=$(echo "$list_response" | jq -r '.data[] .attributes | "\(.name)\t\(.ip):\(.port)\t\(.players)/\(.maxPlayers)\t\(.details.time)\t\(.status)\t\(.id)"') list=$(echo "$list_response" | jq -r '.data[] .attributes | "\(.name)\t\(.ip):\(.port)\t\(.players)/\(.maxPlayers)\t\(.details.time)\t\(.status)\t\(.id)"')
idarr+=("$list") idarr+=("$list")

1
news Normal file
View file

@ -0,0 +1 @@
NEWS: Emergency hotfix for small server lists breaking table