Commit d21849c1 authored by Alex Smith's avatar Alex Smith

support appid as name on listSteamGames

Добавил поддержку игр у которых вместо названия используется SteamAppId Для них appid берется из названии игры, а name из имени скрипта
parent 1d2ac06f
...@@ -243,10 +243,21 @@ listSteamGames() { ...@@ -243,10 +243,21 @@ listSteamGames() {
jq -r '.[] | tostring' <<< "$(listNonSteamGames)" | while read -r game; do jq -r '.[] | tostring' <<< "$(listNonSteamGames)" | while read -r game; do
id=$(jq -r '.id' <<< "${game}") id=$(jq -r '.id' <<< "${game}")
name=$(jq -r '.name' <<< "${game}") name=$(jq -r '.name' <<< "${game}")
jq -r \ exe=$(jq -r '.exe' <<< "${game}")
--arg SteamAppId "$(getSteamId "${name}")" \ if [[ "${name}" =~ ^[0-9]+$ ]] && [[ "${exe}" =~ .sh$ ]]; then
--arg SteamGameId "$(getSteamGameId $id)" \ appid="${name}"
'{AppId: .id, SteamAppId: ($SteamAppId | if . == "" then "0" else . end), SteamGameId: $SteamGameId, Name: .name} | tostring' <<< "${game}" name=$(basename "${exe}" .sh)
else
appid="$(getSteamId "${name}")"
[[ -z "${appid}" ]] && appid="0"
fi
gid="$(getSteamGameId $id)"
jq -n \
--arg id "${id}" \
--arg appid "${appid}" \
--arg gid "${gid}" \
--arg name "${name}" \
'{AppId: $id, SteamAppId: $appid, SteamGameId: $gid, Name: $name}'
done done
) | jq -s '.' ) | jq -s '.'
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment