Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Tergoev
PortWINE
Commits
b4a5190c
Commit
b4a5190c
authored
Nov 22, 2024
by
Alex Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cache on getSteamId
parent
aea3d99a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
add_in_steam.sh
data_from_portwine/scripts/add_in_steam.sh
+21
-9
No files found.
data_from_portwine/scripts/add_in_steam.sh
View file @
b4a5190c
...
...
@@ -92,16 +92,28 @@ getAppId() {
getSteamId() {
unset SteamAppId
NOSTAPPNAME="
$1
"
if [[ -n "
${
NOSTAPPNAME
}
" ]]; then
getSteamGridDBId "
${
NOSTAPPNAME
}
" > /dev/null
local cache_file="
${
PORT_WINE_TMP_PATH
:-
/tmp
}
/steamid_cache.json"
[[ -n "
${
1
:-}
" ]] && NOSTAPPNAME="
$1
"
if [[ -z "
${
SteamIds
:-}
" ]] && [[ -f "
${
cache_file
}
" ]]; then
SteamIds=
$(
<
"
${
cache_file
}
"
)
fi
if [[
$SteamGridDBTypeSteam
== true ]]
; then
S
RES=
$(
curl
-Ls
-e
"https://www.steamgriddb.com/game/
${
SteamGridDBId
}
"
"https://www.steamgriddb.com/api/public/game/
${
SteamGridDBId
}
"
)
if jq -e ".success == true" <<< "
${
SRES
}
" > /dev/null 2>&1; then
SteamAppId="
$(
jq
-r
'.data.platforms.steam.id'
<<<
"
${
SRES
}
"
)
"
echo
${
SteamAppId
}
if [[
-n "
${
SteamIds
:-}
" ]] && jq -e --arg key "
$NOSTAPPNAME
" 'has(
$key
)' <<< "
${
SteamIds
}
" > /dev/null
; then
S
teamAppId=
$(
jq
-r
--arg
key
"
${
NOSTAPPNAME
}
"
'.[$key]'
<<<
"
${
SteamIds
}
"
)
else
if [[ -n "
${
1
:-}
" ]]; then
getSteamGridDBId "
${
NOSTAPPNAME
}
" > /dev/null
fi
if [[
$SteamGridDBTypeSteam
== true ]]; then
SRES=
$(
curl
-Ls
-e
"https://www.steamgriddb.com/game/
${
SteamGridDBId
}
"
"https://www.steamgriddb.com/api/public/game/
${
SteamGridDBId
}
"
)
if jq -e ".success == true" <<< "
${
SRES
}
" > /dev/null 2>&1; then
SteamAppId="
$(
jq
-r
'.data.platforms.steam.id'
<<<
"
${
SRES
}
"
)
"
fi
fi
SteamIds=
$(
jq
--arg
key
"
${
NOSTAPPNAME
}
"
--arg
value
"
${
SteamAppId
:-}
"
'. + {($key): $value}'
<<<
"
${
SteamIds
:-$(
jq
-n
'{}'
)}
"
)
echo "
${
SteamIds
}
" > "
${
cache_file
}
"
fi
if [[ -n "
${
SteamAppId
:-}
" ]]; then
echo "
${
SteamAppId
}
"
fi
}
...
...
@@ -116,7 +128,7 @@ getSteamGridDBId() {
SteamGridDBTypeSteam=false
fi
SteamGridDBId="
$(
jq
'.data[0].id'
<<<
"
${
SGDBRES
}
"
)
"
echo
${
SteamGridDBId
}
echo
"
${
SteamGridDBId
}
"
fi
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment