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
1d2ac06f
Commit
1d2ac06f
authored
Feb 12, 2025
by
Alex Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cache steamapplist on getSteamId
Добавил кеширование списка приложений получаемых с сервера steam Так же поиск по этому списку теперь регистронезависимый
parent
f9b8fd06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
add_in_steam.sh
data_from_portwine/scripts/add_in_steam.sh
+8
-1
No files found.
data_from_portwine/scripts/add_in_steam.sh
View file @
1d2ac06f
...
...
@@ -100,6 +100,7 @@ getAppId() {
getSteamId() {
unset SteamAppId
local cache_file="
${
PORT_WINE_TMP_PATH
:-
/tmp
}
/steamid_cache.json"
local applist_cache_file="
${
PORT_WINE_TMP_PATH
:-
/tmp
}
/steamapplist_cache.json"
[[ -n "
${
1
:-}
" ]] && NOSTAPPNAME="
$1
"
if [[ -z "
${
SteamIds
:-}
" ]] && [[ -f "
${
cache_file
}
" ]]; then
SteamIds=
$(
<
"
${
cache_file
}
"
)
...
...
@@ -116,7 +117,13 @@ getSteamId() {
SteamAppId="
$(
jq
-r
'.data.platforms.steam.id'
<<<
"
${
SRES
}
"
)
"
fi
elif [[ "
${
USE_STEAMGRIDDB
:-
1
}
" == "0" ]]; then
SteamAppId="
$(
curl
-s
--connect-timeout
5
-m
10
"https://api.steampowered.com/ISteamApps/GetAppList/v2/"
| jq
--arg
name
"
${
NOSTAPPNAME
}
"
'.applist.apps[] | select(.name == $name) | .appid'
)
"
if [[ ! -f "
${
applist_cache_file
}
" ]] || [[
$(
find
"
${
applist_cache_file
}
"
-mmin
+1440
)
]]; then
applist_data=
$(
curl
-s
--connect-timeout
5
"https://api.steampowered.com/ISteamApps/GetAppList/v2/"
)
[[ -n "
${
applist_data
}
" ]] && echo "
${
applist_data
}
" > "
${
applist_cache_file
}
"
else
applist_data=
$(
<
"
${
applist_cache_file
}
"
)
fi
[[ -n "
${
applist_data
}
" ]] && SteamAppId=
$(
jq
--arg
name
"
${
NOSTAPPNAME
,,
}
"
'.applist.apps[] | select(.name == $name) | .appid'
<<<
"
${
applist_data
,,
}
"
)
fi
SteamIds=
$(
jq
--arg
key
"
${
NOSTAPPNAME
}
"
--arg
value
"
${
SteamAppId
:-}
"
'. + {($key): $value}'
<<<
"
${
SteamIds
:-$(
jq
-n
'{}'
)}
"
)
echo "
${
SteamIds
}
" > "
${
cache_file
}
"
...
...
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