From eb537b6303b44ede882fdfac8575c88ec2a7dae7 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Tue, 10 Oct 2023 19:32:58 +0100 Subject: [PATCH 01/23] SteamGridDB: Overhaul SteamGridDB implementation - Create generic function to download single artwork - Create generic function to call this single-artwork function, to faciliate downloading each artwork type - Create function to then call this function on either one or a list of Steam AppIDs - Use the generic multi-artwork function for addNonSteamGame --- steamtinkerlaunch | 232 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 205 insertions(+), 27 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index d84dde3b..a51172f9 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231010-1" +PROGVERS="v14.0.20231011-1 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -1380,18 +1380,206 @@ function checkSGDbApi { fi } +## Generic function to fetch some artwork from SteamGridDB based on an endpoint +## TODO: Replace all instances of getGrid with this (some functions can just call this standalone with hardcoded endpoint) +## TODO: Steam only officially supports PNGs, test to see if WebP works when manually copied, and if it doesn't, we should try to only download PNG files +## TODO: Add max filesize option? Some artworks are really big, we should skip ones that are too large (though this may mean many animated APNG artworks will get skipped, because APNG can be huge) +function getArtFromSteamGridDB { + if checkSGDbApi && [ "$STLPLAY" -eq 0 ]; then + # Required + SEARCHID="$1" # ID to search on (should be either Steam AppID or Game ID, but we just pass it to the endpoint given) + SEARCHENDPOINT="$2" # Endpoint which should either be an endpoint for Steam games (Steam AppID endpoint) or Non-Steam Games (SGDB Game ID Endpoint) + SGDBFILENAME="${3:-SEARCHID}" # Name to give to file i.e. "124123p.png" (can't use ${SEARCHID}${SUFFIX} because SearchID may not be the AppID) -- Defaults to just using passed AppID + + # Optional + SEARCHSTYLES="$4" + SEARCHDIMS="$5" + SEARCHTYPES="$6" + SEARCHNSFW="$7" + SEARCHHUMOR="$8" + + SGDBHASFILE="${9:-SGDBHASFILE}" # Option to override action to take when file already exists + + SGDB_ENDPOINT_STR="${SEARCHENDPOINT}/$(echo "$SEARCHID" | awk '{print $1}' | paste -s -d, -)" + # Only include query params if provided + # e.g.: "?styles=${SEARCHSTYLES}&dimensions=${SEARCHDIMS}&types=${SGDBTYPES}&nsfw=${SEARCHNSFW}&humor=${SEARCHHUMOR}" + if [ -n "$SEARCHSTYLES" ]; then + SGDB_ENDPOINT_STR+="?styles=${SEARCHSTYLES}" + fi + if [ -n "$SEARCHDIMS" ]; then + SGDB_ENDPOINT_STR+="?dimensions=${SEARCHDIMS}" + fi + if [ -n "$SEARCHTYPES" ]; then + SGDB_ENDPOINT_STR+="?types=${SEARCHTYPES}" + fi + if [ -n "$SEARCHNSFW" ]; then + SGDB_ENDPOINT_STR+="?nsfw=${SEARCHNSFW}" + fi + if [ -n "$SEARCHHUMOR" ]; then + SGDB_ENDPOINT_STR+="?humor=${SEARCHHUMOR}" + fi + + # If the whole batch has no grids we get a 404 and wget gives an error. --content-on-error ensures we still get the response json and the following logic still works + RESPONSE="$("$WGET" --content-on-error --header="Authorization: Bearer $SGDBAPIKEY" -q "$SGDB_ENDPOINT_STR" -O - 2> >(grep -v "SSL_INIT"))" + + if ! "$JQ" -e '.success' 1> /dev/null <<< "$RESPONSE"; then + writelog "INFO" "${FUNCNAME[0]} - The server response wasn't 'success' for this batch of requested games." + fi + + # catch single grid without downloads + RESPONSE_LENGTH=$("$JQ" '.data | length' <<< "$RESPONSE") + if [ "$RESPONSE_LENGTH" = 0 ]; then + writelog "INFO" "${FUNCNAME[0]} - No grid found to download - maybe loosen filters?" + fi + + # TODO: This could be handled by the http return value - 200 is single-part - 207 is multi-part + # Rewrite response object to fit the following loop if the response isn't multi-part + if "$JQ" -e ".data[0].url" 1> /dev/null <<< "$RESPONSE"; then + RESPONSE="{\"success\":true,\"data\":[$RESPONSE]}" + RESPONSE_LENGTH=1 + fi + + for i in $(seq 0 $(("$RESPONSE_LENGTH" - 1))); do + # match the current json array member against the appid list + # this assumes we get the same order back we put in before + if ! "$JQ" -e ".data[$i].success" 1> /dev/null <<< "$RESPONSE"; then + writelog "INFO" "${FUNCNAME[0]} - The server response for '$SEARCHID' wasn't 'success'" + fi + if ! URLSTR=$("$JQ" -e -r ".data[$i].data[0].url" <<< "$RESPONSE"); then + writelog "INFO" "${FUNCNAME[0]} - No grid found to download for '$SEARCHID' - maybe loosen filters?" + fi + + GRIDDLURL="${URLSTR//\"}" + if grep -q "^https" <<< "$GRIDDLURL"; then + DLSRC="${GRIDDLURL//\"}" + + if [ "$SGDBDLTOSTEAM" -eq 1 ] || [ "$FORCESGDBDLTOSTEAM" -eq 1 ]; then + if [ -z "$SUSDA" ]; then + setSteamPaths + fi + if [ -d "$SUIC" ]; then + GRIDDLDIR="${SUIC}/grid" + fi + else + GRIDDLDIR="$STLDLDIR/steamgriddb" + fi + + mkProjDir "$GRIDDLDIR" + + DLDST="${GRIDDLDIR}/${SGDBFILENAME}.${GRIDDLURL##*.}" # Makes filename like ., which could be something like "70_logo.png" (with full path preceding this, so something like "~/Games/Grids/Half-Life/70_logo.png") + STARTDL=1 + + if [ -f "$DLDST" ]; then + if [ "$SGDBHASFILE" == "skip" ]; then + writelog "INFO" "${FUNCNAME[0]} - Download of existing file is set to '$SGDBHASFILE' - doing nothing" + STARTDL=0 + elif [ "$SGDBHASFILE" == "backup" ]; then + BACKDIR="${GRIDDLDIR}/backup" + mkProjDir "$BACKDIR" + writelog "INFO" "${FUNCNAME[0]} - Backup existing file into '$BACKDIR', because SGDBHASFILE is set to '$SGDBHASFILE'" + mv "$DLDST" "$BACKDIR" + elif [ "$SGDBHASFILE" == "replace" ]; then + writelog "INFO" "${FUNCNAME[0]} - Replacing existing file '$DLDST', because SGDBHASFILE is set to '$SGDBHASFILE'" + rm "$DLDST" 2>/dev/null + fi + fi + + if [ "$STARTDL" -eq 1 ]; then + dlCheck "$DLSRC" "$DLDST" "X" "Downloading '$DLSRC' to '$DLDST'" + fi + else + writelog "INFO" "${FUNCNAME[0]} - No grid found to download for '$SEARCHID' - maybe loosen filters?" + fi + done + fi +} + +# Takes in an Steam AppID or list of Steam AppIDs and downloads (hero, logo boxart) for each one +# +# This function can only support Steam AppIDs because we can't easily map SteamGridDB Game IDs and Non-Steam Game AppIDs +# For Steam games, the AppID is the ID we search on; for Non-Steam Games, we search on a specific Game ID +# In future, we could make a separate function for this +function getSteamGridDBArtwork { + # Download artwork with given parameters for each ID passed in + # Split into batches of 100 games - too many and cloudflare blocks requests because of a too big header file + while mapfile -t -n 100 ary && ((${#ary[@]})); do + SGDBSEARCHAID=$(printf '%s\n' "${ary[@]}") + + commandlineGetSteamGridDBArtwork -id="$SGDBSEARCHAID" --steam + done <<< "${1}" +} + +# We will use this to get either Steam or Non-Steam artwork depending on a flag +# This flag will never be passed by the user, internally we will automatically handle passing the --steam or --nonsteam flag +# When called from the commandline we will have two separate commands, one for Steam and one for Non-Steam, but both will call this function and pass the relevant flag +# +# This function can be used on the commandline or just when we want to search for a game by Game ID +function commandlineGetSteamGridDBArtwork { + SGDBENDPOINTTYPE="game" + GSGDBA_HASFILE="$SGDBHASFILE" # Optional override for how to handle if file already exists (getArtFromSteamGridDB defaults to '$SGDBHASFILE') + for i in "${@}"; do + case $i in + -id=*) + GSGDBA_APPID="${i#*=}" + GSGDBA_FILENAME="${GSGDBA_APPID}" # By default, file will be named with a suffix for each grid type (only non-steam games need this overridden since they search on Game ID and not Steam AppID) + shift ;; + --steam) + SGDBENDPOINTTYPE="steam" # used to generate the correct endpoint to hit, defaults to /heroes/game but this will make it heroes/steam + shift ;; + --nonsteam) + SGDBENDPOINTTYPE="game" + shift ;; + --filename-appid=*) + GSGDBA_FILENAME="${i#*=}" # AppID to use in filename (Non-Steam Games need a different AppID) + shift ;; + ## OPTIONAL: Override Global Menu setting for how to handle existing artwork + ## + ## (in case user wants to replace all existing artwork, default STL setting is 'skip' and will only copy files over to grid dir if they don't exist, so user can easily + ## fill in missing artwork only) + --replace-existing) + GSGDBA_HASFILE="replace" + shift ;; + --backup-existing) + GSGDBA_HASFILE="backup" + shift ;; + --skip-existing) + GSGDBA_HASFILE="skip" + shift ;; + esac + done + + SGDBSEARCHENDPOINT_HERO="${BASESTEAMGRIDDBAPI}/heroes/${SGDBENDPOINTTYPE}" + SGDBSEARCHENDPOINT_LOGO="${BASESTEAMGRIDDBAPI}/logos/${SGDBENDPOINTTYPE}" + SGDBSEARCHENDPOINT_BOXART="${BASESTEAMGRIDDBAPI}/grids/${SGDBENDPOINTTYPE}" + + # Download Hero, Logo, Boxart from SteamGridDB from given endpoint using given AppID + # TODO pass values for style,dimension,etc from Global Menu once we have these options (Steam+Non-Steam share same settings) + getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "" "" "" "" "" "$GSGDBA_HASFILE" + getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_LOGO" "${GSGDBA_FILENAME}_logo" "" "" "" "" "" "$GSGDBA_HASFILE" + getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}p" "" "" "" "" "" "$GSGDBA_HASFILE" +} + + +############################################# + + # Takes a list of appids separated by newlines +# LEGACY: REPLACE WITH "getArtFromSteamGridDB" WHICH IS A GENERIC VERSION OF THIS FOR DOWNLOADING ARTWORK FROM STEAMGRIDDB function getGrids { if checkSGDbApi && [ "$STLPLAY" -eq 0 ]; then - CHOSENAPI="${2:-STEAMGRIDDBAPI}" # Endpoint (i.e. different one for different grids) + LEGACYENDPOINT="$BASESTEAMGRIDDBAPI/grids/steam" + + # CHOSENAPI="${2:-LEGACYENDPOINT}" # Endpoint (i.e. different one for different grids) FORCESGDBDLTOSTEAM="${3:-0}" # Force Non-Steam games to always download to SteamGrid dir GRIDNAMEAPPIDOVERRIDE="$4" # Override the AppID used for the grid, useful if the ID searched on is not the Steam AppID + SGDBHASFILE="${5:-SGDBHASFILE}" # Option to override action to take when file already exists + # Split into batches of 100 games - too many and cloudflare blocks requests because of a too big header file while mapfile -t -n 100 ary && ((${#ary[@]})); do PART=$(printf '%s\n' "${ary[@]}") # If the whole batch has no grids we get a 404 and wget gives an error. --content-on-error ensures we still get the response json and the following logic still works - RESPONSE="$("$WGET" --content-on-error --header="Authorization: Bearer $SGDBAPIKEY" -q "${CHOSENAPI}/$(echo "$PART" | awk '{print $1}' | paste -s -d, -)?styles=${SGDBSTYLES}&dimensions=${SGDBDIMS}&types=${SGDBTYPES}&nsfw=${SGDBNSFW}&humor=${SGDBHUMOR}" -O - 2> >(grep -v "SSL_INIT"))" + RESPONSE="$("$WGET" --content-on-error --header="Authorization: Bearer $SGDBAPIKEY" -q "${LEGACYENDPOINT}/$(echo "$PART" | awk '{print $1}' | paste -s -d, -)?styles=${SGDBSTYLES}&dimensions=${SGDBDIMS}&types=${SGDBTYPES}&nsfw=${SGDBNSFW}&humor=${SGDBHUMOR}" -O - 2> >(grep -v "SSL_INIT"))" if ! "$JQ" -e '.success' 1> /dev/null <<< "$RESPONSE"; then writelog "INFO" "${FUNCNAME[0]} - The server response wasn't 'success' for this batch of requested games." @@ -1477,9 +1665,14 @@ function getGrids { fi } + +############################################# + + function getGridsForOwnedGames { if checkSGDbApi; then - getGrids "$(getOwnedAids)" + getSteamGridDBArtwork "$(getOwnedAids)" + # getGrids "$(getOwnedAids)" fi } @@ -1488,24 +1681,8 @@ function getGridsForInstalledGames { if [ "$(listInstalledGameIDs | wc -l)" -eq 0 ]; then writelog "SKIP" "${FUNCNAME[0]} - No installed games found!" else - getGrids "$(listInstalledGameIDs)" - fi - fi -} - -# TODO implement this for general use on the commandline if not already supported! -# Right now it can only be used when adding a Non-Steam Game and not retroactively -function getGridsForNonSteamGame { - STEAMGRIDDBGAMEID="$1" - NONSTEAMAPPID="$2" - - # "1" "3963591317" - if checkSGDbApi; then - if [ -n "$STEAMGRIDDBGAMEID" ]; then - writelog "INFO" "${FUNCNAME[0]} - Getting grids for Non-Steam Game from SteamGridDB for SteamGridDB Ghttps://www.steamgriddb.com/grid/74151ame ID of '${STEAMGRIDDBGAMEID}'" - getGrids "$STEAMGRIDDBGAMEID" "$STEAMGRIDDBNOSTAPI" "1" "$NONSTEAMAPPID" - else - writelog "SKIP" "${FUNCNAME[0]} - No SteamGridDB Game ID provided -- skipping" + getSteamGridDBArtwork "$(getInstalledGameIDs)" + # getGrids "$(listInstalledGameIDs)" fi fi } @@ -2720,8 +2897,7 @@ function setDefaultCfgValues { if [ -z "$STASSURL" ] ; then STASSURL="https://steamcdn-a.akamaihd.net/steam/apps"; fi if [ -z "$WINETRICKSURL" ] ; then WINETRICKSURL="$GHURL/Winetricks/winetricks"; fi if [ -z "$X64DBGURL" ] ; then X64DBGURL="$GHURL/x64dbg/x64dbg/releases/tag/snapshot";fi - if [ -z "$STEAMGRIDDBAPI" ] ; then STEAMGRIDDBAPI="https://www.steamgriddb.com/api/v2/grids/steam";fi - if [ -z "$STEAMGRIDDBNOSTAPI" ] ; then STEAMGRIDDBNOSTAPI="https://www.steamgriddb.com/api/v2/grids/game";fi + if [ -z "$BASESTEAMGRIDDBAPI" ] ; then BASESTEAMGRIDDBAPI="https://www.steamgriddb.com/api/v2";fi if [ -z "$CONTYRELURL" ] ; then CONTYRELURL="$GHURL/Kron4ek/Conty/releases"; fi if [ -z "$MO2PROJURL" ] ; then MO2PROJURL="$GHURL/ModOrganizer2/modorganizer"; fi if [ -z "$HMMPROJURL" ] ; then HMMPROJURL="$GHURL/thesupersonic16/HedgeModManager"; fi @@ -3087,7 +3263,7 @@ function saveCfg { echo "## x64dbg URL" echo "X64DBGURL=\"$X64DBGURL\"" echo "## SteamGridDB Api URL" - echo "STEAMGRIDDBAPI=\"$STEAMGRIDDBAPI\"" + echo "BASESTEAMGRIDDBAPI=\"$BASESTEAMGRIDDBAPI\"" echo "## Conty DL URL" echo "CONTYRELURL=\"$CONTYRELURL\"" echo "## Mod Organizer 2 Project URL" @@ -5476,7 +5652,7 @@ function AllSettingsEntriesDummyFunction { --field=" $GUI_STASSURL!$DESC_STASSURL ('STASSURL')" "${STASSURL/#-/ -}" `#CAT_Urls` `#MENU_URL` \ --field=" $GUI_WINETRICKSURL!$DESC_WINETRICKSURL ('WINETRICKSURL')" "${WINETRICKSURL/#-/ -}" `#CAT_Urls` `#MENU_URL` \ --field=" $GUI_X64DBGURL!$DESC_X64DBGURL ('X64DBGURL')" "${X64DBGURL/#-/ -}" `#CAT_Urls` `#MENU_URL` \ ---field=" $GUI_STEAMGRIDDBAPI!$DESC_STEAMGRIDDBAPI ('STEAMGRIDDBAPI')" "${STEAMGRIDDBAPI/#-/ -}" `#CAT_Urls` `#MENU_URL` \ +--field=" $GUI_STEAMGRIDDBAPI!$DESC_STEAMGRIDDBAPI ('BASESTEAMGRIDDBAPI')" "${BASESTEAMGRIDDBAPI/#-/ -}" `#CAT_Urls` `#MENU_URL` \ --field=" $GUI_CONTYRELURL!$DESC_CONTYRELURL ('CONTYRELURL')" "${CONTYRELURL/#-/ -}" `#CAT_Urls` `#MENU_URL` \ --field=" $GUI_MO2DLURL!$DESC_MO2DLURL ('MO2PROJURL')" "${MO2PROJURL/#-/ -}" `#CAT_Urls` `#MENU_URL` \ --field=" $GUI_HMMDLURL!$DESC_HMMDLURL ('HMMPROJURL')" "${HMMPROJURL/#-/ -}" `#CAT_Urls` `#MENU_URL` \ @@ -23201,9 +23377,11 @@ function addNonSteamGame { NOSTICONPATH="$( findGameArtInExeDir "$NOSTEXEBASEDIR" "icon" "$NOSTICONPATH" )" fi + # TODO support icons from SteamGridDB (these have to be written to the VDF file, how can we save and set these?) if [ "$NOSTUSESGDB" -eq 1 ]; then # SteamGridDB ID and Non-Steam Game AppID, respectively - getGridsForNonSteamGame "$NOSTSGDBGAMEID" "$NOSTAIDGRID" + # getGridsForNonSteamGame "$NOSTSGDBGAMEID" "$NOSTAIDGRID" + commandlineGetSteamGridDBArtwork -id="$NOSTSGDBGAMEID" --filename-appid="$NOSTAIDGRID" --nonsteam fi writelog "INFO" "${FUNCNAME[0]} - Adding new set '$NEWSET'" From c9cd97c73a2676bbf9b6859da5c8b267a262b760 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Tue, 10 Oct 2023 19:51:23 +0100 Subject: [PATCH 02/23] SteamGridDB: Update commandlineGetSteamGridDBArtwork flags * Change --id to --search-id, to better reflect its purpose * Add --apply option, which tells getArtFromSteamGridDB to save the artwork to Steam regardless of what the Global Menu setting says --- steamtinkerlaunch | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index a51172f9..d73dcde8 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231011-1 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231011-2 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -1400,6 +1400,8 @@ function getArtFromSteamGridDB { SGDBHASFILE="${9:-SGDBHASFILE}" # Option to override action to take when file already exists + FORCESGDBDLTOSTEAM="${10}" # Option to force downloading artwork to Steam Grid folder + SGDB_ENDPOINT_STR="${SEARCHENDPOINT}/$(echo "$SEARCHID" | awk '{print $1}' | paste -s -d, -)" # Only include query params if provided # e.g.: "?styles=${SEARCHSTYLES}&dimensions=${SEARCHDIMS}&types=${SGDBTYPES}&nsfw=${SEARCHNSFW}&humor=${SEARCHHUMOR}" @@ -1505,7 +1507,7 @@ function getSteamGridDBArtwork { while mapfile -t -n 100 ary && ((${#ary[@]})); do SGDBSEARCHAID=$(printf '%s\n' "${ary[@]}") - commandlineGetSteamGridDBArtwork -id="$SGDBSEARCHAID" --steam + commandlineGetSteamGridDBArtwork --search-id="$SGDBSEARCHAID" --steam done <<< "${1}" } @@ -1517,9 +1519,10 @@ function getSteamGridDBArtwork { function commandlineGetSteamGridDBArtwork { SGDBENDPOINTTYPE="game" GSGDBA_HASFILE="$SGDBHASFILE" # Optional override for how to handle if file already exists (getArtFromSteamGridDB defaults to '$SGDBHASFILE') + GSGDBA_APPLYARTWORK="0" for i in "${@}"; do case $i in - -id=*) + --search-id=*) # ID to hit the SteamGridDB API endpoint with (for Steam games this is the AppID which we will also use as filename) GSGDBA_APPID="${i#*=}" GSGDBA_FILENAME="${GSGDBA_APPID}" # By default, file will be named with a suffix for each grid type (only non-steam games need this overridden since they search on Game ID and not Steam AppID) shift ;; @@ -1545,6 +1548,9 @@ function commandlineGetSteamGridDBArtwork { --skip-existing) GSGDBA_HASFILE="skip" shift ;; + ## OPTIONAL: Flag to force downloading to SteamGridDB folder (used for addNonSteamGame internally) + --apply) + GSGDBA_APPLYARTWORK="1" esac done @@ -1554,9 +1560,9 @@ function commandlineGetSteamGridDBArtwork { # Download Hero, Logo, Boxart from SteamGridDB from given endpoint using given AppID # TODO pass values for style,dimension,etc from Global Menu once we have these options (Steam+Non-Steam share same settings) - getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "" "" "" "" "" "$GSGDBA_HASFILE" - getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_LOGO" "${GSGDBA_FILENAME}_logo" "" "" "" "" "" "$GSGDBA_HASFILE" - getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}p" "" "" "" "" "" "$GSGDBA_HASFILE" + getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_LOGO" "${GSGDBA_FILENAME}_logo" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}p" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" } @@ -23378,10 +23384,12 @@ function addNonSteamGame { fi # TODO support icons from SteamGridDB (these have to be written to the VDF file, how can we save and set these?) + # We could do this by making a separate "getArtFromSteamGridDB" call and saving the icon to the grids folder, then copying that path and using it when we're writing out the icon (i.e set the value of "NOSTICONPATH" if the icon file was successfully found on SteamGridDB) + # Maybe we could make a dedicated function for getting icons? if [ "$NOSTUSESGDB" -eq 1 ]; then # SteamGridDB ID and Non-Steam Game AppID, respectively # getGridsForNonSteamGame "$NOSTSGDBGAMEID" "$NOSTAIDGRID" - commandlineGetSteamGridDBArtwork -id="$NOSTSGDBGAMEID" --filename-appid="$NOSTAIDGRID" --nonsteam + commandlineGetSteamGridDBArtwork --search-id="$NOSTSGDBGAMEID" --filename-appid="$NOSTAIDGRID" --nonsteam fi writelog "INFO" "${FUNCNAME[0]} - Adding new set '$NEWSET'" From 17e62b850ace3b0d20a637683be269e6179ced7b Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Tue, 10 Oct 2023 20:11:29 +0100 Subject: [PATCH 03/23] Minor --- steamtinkerlaunch | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index d73dcde8..d8c9c0db 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231011-2 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231011-3 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -1575,7 +1575,6 @@ function getGrids { if checkSGDbApi && [ "$STLPLAY" -eq 0 ]; then LEGACYENDPOINT="$BASESTEAMGRIDDBAPI/grids/steam" - # CHOSENAPI="${2:-LEGACYENDPOINT}" # Endpoint (i.e. different one for different grids) FORCESGDBDLTOSTEAM="${3:-0}" # Force Non-Steam games to always download to SteamGrid dir GRIDNAMEAPPIDOVERRIDE="$4" # Override the AppID used for the grid, useful if the ID searched on is not the Steam AppID @@ -1678,17 +1677,14 @@ function getGrids { function getGridsForOwnedGames { if checkSGDbApi; then getSteamGridDBArtwork "$(getOwnedAids)" - # getGrids "$(getOwnedAids)" fi } - function getGridsForInstalledGames { if checkSGDbApi; then if [ "$(listInstalledGameIDs | wc -l)" -eq 0 ]; then writelog "SKIP" "${FUNCNAME[0]} - No installed games found!" else getSteamGridDBArtwork "$(getInstalledGameIDs)" - # getGrids "$(listInstalledGameIDs)" fi fi } From 2fb05afe45d2db653a97c421f1d99bdf7c99e711 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Wed, 11 Oct 2023 16:58:02 +0100 Subject: [PATCH 04/23] SteamGridDB: Rename getArtFromSteamGridDB to downloadArtFromSteamGridDB --- steamtinkerlaunch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index d8c9c0db..75d6f078 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -1384,7 +1384,7 @@ function checkSGDbApi { ## TODO: Replace all instances of getGrid with this (some functions can just call this standalone with hardcoded endpoint) ## TODO: Steam only officially supports PNGs, test to see if WebP works when manually copied, and if it doesn't, we should try to only download PNG files ## TODO: Add max filesize option? Some artworks are really big, we should skip ones that are too large (though this may mean many animated APNG artworks will get skipped, because APNG can be huge) -function getArtFromSteamGridDB { +function downloadArtFromSteamGridDB { if checkSGDbApi && [ "$STLPLAY" -eq 0 ]; then # Required SEARCHID="$1" # ID to search on (should be either Steam AppID or Game ID, but we just pass it to the endpoint given) @@ -1518,7 +1518,7 @@ function getSteamGridDBArtwork { # This function can be used on the commandline or just when we want to search for a game by Game ID function commandlineGetSteamGridDBArtwork { SGDBENDPOINTTYPE="game" - GSGDBA_HASFILE="$SGDBHASFILE" # Optional override for how to handle if file already exists (getArtFromSteamGridDB defaults to '$SGDBHASFILE') + GSGDBA_HASFILE="$SGDBHASFILE" # Optional override for how to handle if file already exists (downloadArtFromSteamGridDB defaults to '$SGDBHASFILE') GSGDBA_APPLYARTWORK="0" for i in "${@}"; do case $i in @@ -1560,9 +1560,9 @@ function commandlineGetSteamGridDBArtwork { # Download Hero, Logo, Boxart from SteamGridDB from given endpoint using given AppID # TODO pass values for style,dimension,etc from Global Menu once we have these options (Steam+Non-Steam share same settings) - getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" - getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_LOGO" "${GSGDBA_FILENAME}_logo" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" - getArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}p" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_LOGO" "${GSGDBA_FILENAME}_logo" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}p" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" } @@ -1570,7 +1570,7 @@ function commandlineGetSteamGridDBArtwork { # Takes a list of appids separated by newlines -# LEGACY: REPLACE WITH "getArtFromSteamGridDB" WHICH IS A GENERIC VERSION OF THIS FOR DOWNLOADING ARTWORK FROM STEAMGRIDDB +# LEGACY: REPLACE WITH "downloadArtFromSteamGridDB" WHICH IS A GENERIC VERSION OF THIS FOR DOWNLOADING ARTWORK FROM STEAMGRIDDB function getGrids { if checkSGDbApi && [ "$STLPLAY" -eq 0 ]; then LEGACYENDPOINT="$BASESTEAMGRIDDBAPI/grids/steam" @@ -23380,7 +23380,7 @@ function addNonSteamGame { fi # TODO support icons from SteamGridDB (these have to be written to the VDF file, how can we save and set these?) - # We could do this by making a separate "getArtFromSteamGridDB" call and saving the icon to the grids folder, then copying that path and using it when we're writing out the icon (i.e set the value of "NOSTICONPATH" if the icon file was successfully found on SteamGridDB) + # We could do this by making a separate "downloadArtFromSteamGridDB" call and saving the icon to the grids folder, then copying that path and using it when we're writing out the icon (i.e set the value of "NOSTICONPATH" if the icon file was successfully found on SteamGridDB) # Maybe we could make a dedicated function for getting icons? if [ "$NOSTUSESGDB" -eq 1 ]; then # SteamGridDB ID and Non-Steam Game AppID, respectively From 2c6e010018d4f1ac21128417e5eec82638ce0946 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Sat, 14 Oct 2023 18:11:01 +0100 Subject: [PATCH 05/23] SteamGridDB: Add command to set single game artwork --- steamtinkerlaunch | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 75d6f078..08f67f66 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231011-3 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231015-1 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -21401,6 +21401,23 @@ function howto { echo " steamdeckcompat Get information about Steam Deck compatibility for " echo " Will work offline if the information has been fetched before" echo " (for 'SteamAppID' or 'last')" + echo " steamgriddb|sgdb Download most relevant artwork from SteamGridDB based on Steam AppID or SteamGridDB Game ID" + echo " Attempts to search for and download hero, logo, and boxart from SteamGridDB, and can optionally" + echo " apply this artwork to the game in your Steam library, by giving it the AppID of the game to use" + echo " in the filename." + echo " This setting uses preferences specified on Global Menu under SteamGridDB options, such as" + echo " dimensions, and how to manage existing files (though an override can be specified for how" + echo " to manage existing artwork files)." + echo " :" + echo " --search-id= Steam AppID or SteamGridDB Game ID to search for (ex: AppID 22330 or Game ID 5258102)" + echo " --filename-appid= Steam AppID to use when naming the file, only required when searching on Game ID so the artwork is applied to the correct Shortcut" + echo " --steam The Search ID passed is for a Steam AppID" + echo " --nonsteam The Search ID passed is for a SteamGridDB Game ID" + echo " --apply Apply the downloaded game artwork to the Steam game (if not set, artwork will be downloaded to SteamTinkerLaunch Grid directory only)" + echo " --skip-existing Skip setting artwork for this game if it already has custom artwork" + echo " --replace-existing Replace existing artwork files for this game -- they cannot be recovered later" + echo " --backup-existing Backup existing artwork files for this game before replacing them, so they can be restored" + echo "" echo " steamworksshared|sws Steamworks Shared:" echo " : Options:" echo " List packages - or" @@ -21930,6 +21947,9 @@ function commandline { else howto fi + elif [ "$1" == "steamgriddb" ] || [ "$1" == "sgdb" ]; then + # This is the new SteamGridDB commandline usage, we just expose direct function to commandline + commandlineGetSteamGridDBArtwork "$@" elif [ "$1" == "update" ]; then if [ -n "$2" ]; then if [ "$2" == "gamedata" ]; then From afad3e8cbe24606dbd02d7e9ee327b122aa75463 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 18:01:11 +0100 Subject: [PATCH 06/23] SteamGridDB: Temporarily hardcode tenfoot endpoint --- steamtinkerlaunch | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 08f67f66..cd827f7d 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231015-1 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231017-1 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -1558,11 +1558,15 @@ function commandlineGetSteamGridDBArtwork { SGDBSEARCHENDPOINT_LOGO="${BASESTEAMGRIDDBAPI}/logos/${SGDBENDPOINTTYPE}" SGDBSEARCHENDPOINT_BOXART="${BASESTEAMGRIDDBAPI}/grids/${SGDBENDPOINTTYPE}" - # Download Hero, Logo, Boxart from SteamGridDB from given endpoint using given AppID + # Download Hero, Logo, Boxart, Tenfoot from SteamGridDB from given endpoint using given AppID + # On SteamGridDB, tenfoot is grouped with grids, but as a horizontal Steam grid, so we fetch it by passing specific dimensions matching this + # Users are free to override this, but the default is what SteamGridDB expects for the tenfoot sizes + # # TODO pass values for style,dimension,etc from Global Menu once we have these options (Steam+Non-Steam share same settings) downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_LOGO" "${GSGDBA_FILENAME}_logo" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}p" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}" "" "920x430,460x215" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" } From 0ecf32aa1cd204a502826d4ccca95b547e214f21 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 19:09:27 +0100 Subject: [PATCH 07/23] SteamGridDB: Initial GUI options for new artworks --- lang/english.txt | 12 +++- steamtinkerlaunch | 175 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 156 insertions(+), 31 deletions(-) diff --git a/lang/english.txt b/lang/english.txt index 7a72e324..d4cdeee7 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -462,7 +462,7 @@ GUI_OPTSGRID="SteamGridDB options" GUI_SGDBSTYLES="Styles" DESC_SGDBSTYLES="Style filter options" GUI_SGDBDIMS="Dimensions" -DESC_SGDBDIMS="Dimension filter options" +DESC_SGDBDIMS="Dimension filter options, in order of priority" GUI_SGDBTYPES="Types" DESC_SGDBTYPES="Type filter options" GUI_SGDBNSFW="NSFW" @@ -1241,3 +1241,13 @@ GUI_NOSTSGDBAID="SteamGridDB Game ID (optional)" DESC_NOSTSGDBAID="the SteamGridDB Game ID to search on to find grids automatically (requires SteamGridDB API key set on Global Menu) -- This will respect the SteamGridDB options on the Global Menu" GUI_USESPEKD3D47="Use d3dcompiler_47 with SpecialK" DESC_USESPEKD3D47="copy d3dcompiler_47 to game files, normally required but sometimes OS/drivers/SpecialK/ReShade may crash with it -- Disabling will remove this DLL only if it was installed by SteamTinkerLaunch for SpecialK" +GUI_SGDBDLHERO="Download Hero Artwork" +DESC_SGDBDLHERO="enable downloading Hero (banner) artwork from SteamGridDB" +GUI_SGDBDLLOGO="Download Logo Artwork" +DESC_SGDBDLLOGO="enable downloading Logo artwork from SteamGridDB" +GUI_SGDBDLBOXART="Download Boxart" +DESC_SGDBDLBOXART="enable downloading Boxart (vertical grid) artwork from SteamGridDB" +GUI_SGDBDLTENFOOT="Download Tenfoot" +DESC_SGDBDLTENFOOT="enable downloading Tenfoot (Horizontal grid) artwork from SteamGridDB" +GUI_SGDBEPILEPSY="Epilepsy" +DESC_SGDBEPILEPSY="epilepsy options" diff --git a/steamtinkerlaunch b/steamtinkerlaunch index cd827f7d..41b89115 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231017-1 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231017-3 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -324,8 +324,14 @@ APIN="appinfo" SLO="Steam Launch Option" SOMEPOPULARWINEPAKS="dotnet4 quartz xact" SOMEWINEDEBUGOPTIONS="-all,+steam,+vrclient,+vulkan" -SGDBDIMOPTS="600x900,342x482,660x930" +DEFSGDBHERODIMS="3840x1240,1280x620" +DEFSGDBBOXARTDIMS="600x900" +DEFSGDBTENFOOTDIMS="920x430,460x215" +SGDBTYPEOPTS="static!animated!static,animated!animated,static" +SGDBTAGOPTS="any!true!false" SGDBSTYOPTS="alternate,blurred,white_logo,material,no_logo" +# TODO check where this is used and remove +SGDBDIMOPTS="600x900,342x482,660x930" GETSTAID="99[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]99" STLGAMES="$STLCFGDIR/games" @@ -1397,10 +1403,11 @@ function downloadArtFromSteamGridDB { SEARCHTYPES="$6" SEARCHNSFW="$7" SEARCHHUMOR="$8" + SEARCHEPILEPSY="$9" - SGDBHASFILE="${9:-SGDBHASFILE}" # Option to override action to take when file already exists + SGDBHASFILE="${10:-SGDBHASFILE}" # Option to override action to take when file already exists - FORCESGDBDLTOSTEAM="${10}" # Option to force downloading artwork to Steam Grid folder + FORCESGDBDLTOSTEAM="${11}" # Option to force downloading artwork to Steam Grid folder SGDB_ENDPOINT_STR="${SEARCHENDPOINT}/$(echo "$SEARCHID" | awk '{print $1}' | paste -s -d, -)" # Only include query params if provided @@ -1420,6 +1427,9 @@ function downloadArtFromSteamGridDB { if [ -n "$SEARCHHUMOR" ]; then SGDB_ENDPOINT_STR+="?humor=${SEARCHHUMOR}" fi + if [ -n "$SEARCHEPILEPSY" ]; then + SGDB_ENDPOINT_STR+="?epilepsy=${SEARCHEPILEPSY}" + fi # If the whole batch has no grids we get a 404 and wget gives an error. --content-on-error ensures we still get the response json and the following logic still works RESPONSE="$("$WGET" --content-on-error --header="Authorization: Bearer $SGDBAPIKEY" -q "$SGDB_ENDPOINT_STR" -O - 2> >(grep -v "SSL_INIT"))" @@ -1556,17 +1566,34 @@ function commandlineGetSteamGridDBArtwork { SGDBSEARCHENDPOINT_HERO="${BASESTEAMGRIDDBAPI}/heroes/${SGDBENDPOINTTYPE}" SGDBSEARCHENDPOINT_LOGO="${BASESTEAMGRIDDBAPI}/logos/${SGDBENDPOINTTYPE}" - SGDBSEARCHENDPOINT_BOXART="${BASESTEAMGRIDDBAPI}/grids/${SGDBENDPOINTTYPE}" + SGDBSEARCHENDPOINT_BOXART="${BASESTEAMGRIDDBAPI}/grids/${SGDBENDPOINTTYPE}" # Grid endpoint is used for Boxart and Tenfoot, which SteamGridDB counts as vertical/horizontal grids respectively + + # TODO + # - Consider making --steam the default + # - Consider making --apply the default, and having --no-apply as the explicit option # Download Hero, Logo, Boxart, Tenfoot from SteamGridDB from given endpoint using given AppID # On SteamGridDB, tenfoot is grouped with grids, but as a horizontal Steam grid, so we fetch it by passing specific dimensions matching this # Users are free to override this, but the default is what SteamGridDB expects for the tenfoot sizes - # + # # TODO pass values for style,dimension,etc from Global Menu once we have these options (Steam+Non-Steam share same settings) - downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" - downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_LOGO" "${GSGDBA_FILENAME}_logo" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" - downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}p" "" "" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" - downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}" "" "920x430,460x215" "" "" "" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + if [ "$SGDBDLHERO" -eq 1 ]; then + writelog "INFO" "${FUNCNAME[0]} - Downloading Hero artwork, because SGDBDLHERO is '$SGDBDLHERO'" + downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "$SGDBHEROSTYLES" "$SGDBHERODIMS" "$SGDBHEROTYPES" "$SGDBHERONSFW" "$SGDBHEROHUMOR" "$SGDBHEROEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + fi + if [ "$SGDBDLLOGO" -eq 1 ]; then + # Logo doesn't have dimensions, so it's left intentionally blank + writelog "INFO" "${FUNCNAME[0]} - Downloading Logo artwork, because SGDBDLLOGO is '$SGDBDLLOGO'" + downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_LOGO" "${GSGDBA_FILENAME}_logo" "$SGDBLOGOSTYLES" "" "$SGDBLOGOTYPES" "$SGDBLOGONSFW" "$SGDBLOGOHUMOR" "$SGDBLOGOEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + fi + if [ "$SGDBDLBOXART" -eq 1 ]; then + writelog "INFO" "${FUNCNAME[0]} - Downloading Boxart (Steam Vertical Grid) artwork, because SGDBDLBOXART is '$SGDBDLBOXART'" + downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}p" "$SGDBBOXARTSTYLES" "$SGDBBOXARTDIMS" "$SGDBBOXARTTYPES" "$SGDBBOXARTNSFW" "$SGDBBOXARTHUMOR" "$SGDBBOXARTEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + fi + if [ "$SGDBDLTENFOOT" -eq 1 ]; then + writelog "INFO" "${FUNCNAME[0]} - Downloading Tenfoot (Steam Horizontal Grid) artwork, because SGDBDLTENFOOT is '$SGDBDLTENFOOT'" + downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}" "$SGDBTENFOOTSTYLES" "$SGDBTENFOOTDIMS" "$SGDBTENFOOTTYPES" "$SGDBTENFOOTNSFW" "$SGDBTENFOOTHUMOR" "$SGDBTENFOOTEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" + fi } @@ -3000,14 +3027,36 @@ function setDefaultCfgValues { if [ -z "$DISABLE_AUTOSTAGES" ] ; then DISABLE_AUTOSTAGES="0"; fi if [ -z "$NOSTEAMSTLDEF" ] ; then NOSTEAMSTLDEF="0"; fi if [ -z "$SGDBAPIKEY" ] ; then SGDBAPIKEY="$NON"; fi - if [ -z "$SGDBSTYLES" ] ; then SGDBSTYLES="$SGDBSTYOPTS"; fi - if [ -z "$SGDBDIMS" ] ; then SGDBDIMS="$SGDBDIMOPTS"; fi - if [ -z "$SGDBTYPES" ] ; then SGDBTYPES="animated,static"; fi - if [ -z "$SGDBNSFW" ] ; then SGDBNSFW="any"; fi - if [ -z "$SGDBHUMOR" ] ; then SGDBHUMOR="any"; fi if [ -z "$SGDBDLTOSTEAM" ] ; then SGDBDLTOSTEAM="0"; fi if [ -z "$SGDBHASFILE" ] ; then SGDBHASFILE="skip"; fi if [ -z "$SGDBAUTODL" ] ; then SGDBAUTODL="$NON"; fi + if [ -z "$SGDBDLHERO" ] ; then SGDBDLHERO="1"; fi + if [ -z "$SGDBDLLOGO" ] ; then SGDBDLLOGO="1"; fi + if [ -z "$SGDBDLBOXART" ] ; then SGDBDLBOXART="1"; fi + if [ -z "$SGDBDLTENFOOT" ] ; then SGDBDLTENFOOT="1"; fi + if [ -z "$SGDBHERODIMS" ] ; then SGDBHERODIMS="$DEFSGDBHERODIMS" + if [ -z "$SGDBHEROTYPES" ] ; then SGDBHEROTYPES="$SGDBTYPEOPTS" + if [ -z "$SGDBHEROSTYLES" ] ; then SGDBHEROSTYLES="$SGDBSTYOPTS" + if [ -z "$SGDBHERONSFW" ] ; then SGDBHERONSFW="any" + if [ -z "$SGDBHEROHUMOR" ] ; then SGDBHEROHUMOR="any" + if [ -z "$SGDBHEROEPILEPSY" ] ; then SGDBHEROEPILEPSY="false" + if [ -z "$SGDBLOGOTYPES" ] ; then SGDBLOGOTYPES="$SGDBTYPEOPTS" + if [ -z "$SGDBLOGOSTYLES" ] ; then SGDBLOGOSTYLES="$SGDBSTYOPTS" + if [ -z "$SGDBLOGONSFW" ] ; then SGDBLOGONSFW="any" + if [ -z "$SGDBLOGOHUMOR" ] ; then SGDBLOGOHUMOR="any" + if [ -z "$SGDBLOGOEPILEPSY" ] ; then SGDBLOGOEPILEPSY="false" + if [ -z "$SGDBBOXARTDIMS" ] ; then SGDBBOXARTDIMS="$DEFSGDBBOXARTDIMS" + if [ -z "$SGDBBOXARTTYPES" ] ; then SGDBBOXARTTYPES="$SGDBTYPEOPTS" + if [ -z "$SGDBBOXARTSTYLES" ] ; then SGDBBOXARTSTYLES="$SGDBSTYOPTS" + if [ -z "$SGDBBOXARTNSFW" ] ; then SGDBBOXARTNSFW="any" + if [ -z "$SGDBBOXARTHUMOR" ] ; then SGDBBOXARTHUMOR="any" + if [ -z "$SGDBBOXARTEPILEPSY" ] ; then SGDBBOXARTEPILEPSY="false" + if [ -z "$SGDBTENFOOTDIMS" ] ; then SGDBTENFOOTDIMS="$DEFSGDBTENFOOTDIMS" + if [ -z "$SGDBTENFOOTTYPES" ] ; then SGDBTENFOOTTYPES="$SGDBTYPEOPTS" + if [ -z "$SGDBTENFOOTSTYLES" ] ; then SGDBTENFOOTSTYLES="$SGDBSTYOPTS" + if [ -z "$SGDBTENFOOTNSFW" ] ; then SGDBTENFOOTNSFW="any" + if [ -z "$SGDBTENFOOTHUMOR" ] ; then SGDBTENFOOTHUMOR="any" + if [ -z "$SGDBTENFOOTEPILEPSY" ] ; then SGDBTENFOOTEPILEPSY="false" if [ -z "$STORECOMPDATTITLE" ] ; then STORECOMPDATTITLE="1"; fi if [ -z "$CUSTCONTY" ] ; then CUSTCONTY="$NON"; fi if [ -z "$UPDATECONTY" ] ; then UPDATECONTY="1"; fi @@ -3487,16 +3536,60 @@ function saveCfg { echo "NOSTEAMSTLDEF=\"$NOSTEAMSTLDEF\"" echo "## $DESC_SGDBAPIKEY" echo "SGDBAPIKEY=\"$SGDBAPIKEY\"" - echo "## $DESC_SGDBSTYLES" - echo "SGDBSTYLES=\"$SGDBSTYLES\"" - echo "## $DESC_SGDBDIMS" - echo "SGDBDIMS=\"$SGDBDIMS\"" - echo "## $DESC_SGDBTYPES" - echo "SGDBTYPES=\"$SGDBTYPES\"" - echo "## $DESC_SGDBNSFW" - echo "SGDBNSFW=\"$SGDBNSFW\"" - echo "## $DESC_SGDBHUMOR" - echo "SGDBHUMOR=\"$SGDBHUMOR\"" + echo "## Hero $DESC_SGDBDLHERO" + echo "SGDBDLHERO=\"$SGDBDLHERO\"" + echo "## Hero $DESC_SGDBDIMS" + echo "SGDBHERODIMS=\"$SGDBHERODIMS\"" + echo "## Hero $DESC_SGDBTYPES" + echo "SGDBHEROTYPES=\"$SGDBHEROTYPES\"" + echo "## Hero $DESC_SGDBSTYLES" + echo "SGDBHEROSTYLES=\"$SGDBHEROSTYLES\"" + echo "## Hero $DESC_SGDBNSFW" + echo "SGDBHERONSFW=\"$SGDBHERONSFW\"" + echo "## Hero $DESC_SGDBHUMOR" + echo "SGDBHEROHUMOR=\"$SGDBHEROHUMOR\"" + echo "## Hero $DESC_SGDBEPILEPSY" + echo "SGDBHEROEPILEPSY=\"$SGDBHEROEPILEPSY\"" + echo "## Logo $DESC_SGDBDLLOGO" + echo "SGDBDLLOGO=\"$SGDBDLLOGO\"" + echo "## Logo $DESC_SGDBTYPES" + echo "SGDBLOGOTYPES=\"$SGDBLOGOTYPES\"" + echo "## Logo $DESC_SGDBSTYLES" + echo "SGDBLOGOSTYLES=\"$SGDBLOGOSTYLES\"" + echo "## Logo $DESC_SGDBNSFW" + echo "SGDBLOGONSFW=\"$SGDBLOGONSFW\"" + echo "## Logo $DESC_SGDBHUMOR" + echo "SGDBLOGOHUMOR=\"$SGDBLOGOHUMOR\"" + echo "## Logo $DESC_SGDBEPILEPSY" + echo "SGDBLOGOEPILEPSY=\"$SGDBLOGOEPILEPSY\"" + echo "## Boxart $DESC_SGDBDLBOXART" + echo "SGDBDLBOXART=\"$SGDBDLBOXART\"" + echo "## Boxart $DESC_SGDBDIMS" + echo "SGDBBOXARTDIMS=\"$SGDBBOXARTDIMS\"" + echo "## Boxart $DESC_SGDBTYPES" + echo "SGDBBOXARTTYPES=\"$SGDBBOXARTTYPES\"" + echo "## Boxart $DESC_SGDBSTYLES" + echo "SGDBBOXARTSTYLES=\"$SGDBBOXARTSTYLES\"" + echo "## Boxart $DESC_SGDBNSFW" + echo "SGDBBOXARTNSFW=\"$SGDBBOXARTNSFW\"" + echo "## Boxart $DESC_SGDBHUMOR" + echo "SGDBBOXARTHUMOR=\"$SGDBBOXARTHUMOR\"" + echo "## Boxart $DESC_SGDBEPILEPSY" + echo "SGDBBOXARTEPILEPSY=\"$SGDBBOXARTEPILEPSY\"" + echo "## Tenfoot $DESC_SGDBDLTENFOOT" + echo "SGDBDLTENFOOT=\"$SGDBDLTENFOOT\"" + echo "## Tenfoot $DESC_SGDBDIMS" + echo "SGDBTENFOOTDIMS=\"$SGDBTENFOOTDIMS\"" + echo "## Tenfoot $DESC_SGDBTYPES" + echo "SGDBTENFOOTTYPES=\"$SGDBTENFOOTTYPES\"" + echo "## Tenfoot $DESC_SGDBSTYLES" + echo "SGDBTENFOOTSTYLES=\"$SGDBTENFOOTSTYLES\"" + echo "## Tenfoot $DESC_SGDBNSFW" + echo "SGDBTENFOOTNSFW=\"$SGDBTENFOOTNSFW\"" + echo "## Tenfoot $DESC_SGDBHUMOR" + echo "SGDBTENFOOTHUMOR=\"$SGDBTENFOOTHUMOR\"" + echo "## Tenfoot $DESC_SGDBEPILEPSY" + echo "SGDBTENFOOTEPILEPSY=\"$SGDBTENFOOTEPILEPSY\"" echo "## $DESC_SGDBDLTOSTEAM" echo "SGDBDLTOSTEAM=\"$SGDBDLTOSTEAM\"" echo "## $DESC_SGDBHASFILE" @@ -5425,11 +5518,33 @@ function AllSettingsEntriesDummyFunction { --field=" $GUI_SGDBAPIKEY!$DESC_SGDBAPIKEY ('SGDBAPIKEY')":CBE "${SGDBAPIKEY/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBHASFILE!$DESC_SGDBHASFILE ('SGDBHASFILE')":CB "$(cleanDropDown "${SGDBHASFILE/#-/ -}" "skip!backup!replace")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBAUTODL!$DESC_SGDBAUTODL ('SGDBAUTODL')":CB "$(cleanDropDown "${SGDBAUTODL/#-/ -}" "$NON!after_game!before_game!no_meta")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBSTYLES')":CBE "$(cleanDropDown "${SGDBSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBDIMS!$DESC_SGDBDIMS ('SGDBDIMS')":CBE "$(cleanDropDown "${SGDBDIMS/#-/ -}" "${SGDBDIMOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBTYPES')":CBE "$(cleanDropDown "${SGDBTYPES/#-/ -}" "animated!static!animated,static!static,animated")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBNSFW')":CBE "$(cleanDropDown "${SGDBNSFW/#-/ -}" "any!false!true")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBHUMOR')":CBE "$(cleanDropDown "${SGDBHUMOR/#-/ -}" "any!false!true")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBDLHERO!$DESC_SGDBDLHERO ('SGDBDLHERO')":CHK "${SGDBDLHERO/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBDIMS!$DESC_SGDBDIMS ('SGDBHERODIMS')":CBE "$(cleanDropDown "${SGDBHERODIMS/#-/ -}" "${DEFSGDBHERODIMS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBHEROTYPES')":CBE "$(cleanDropDown "${SGDBHEROTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBHEROSTYLES')":CBE "$(cleanDropDown "${SGDBHEROSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBHERONSFW')":CBE "$(cleanDropDown "${SGDBHERONSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBHEROHUMOR')":CBE "$(cleanDropDown "${SGDBHEROHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBHEROEPILEPSY')":CHK "$(cleanDropDown ${SGDBHEROEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBDLLOGO!$DESC_SGDBDLLOGO ('SGDBDLLOGO')":CHK "${SGDBDLLOGO/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBLOGOTYPES')":CBE "$(cleanDropDown "${SGDBLOGOTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBLOGOSTYLES')":CBE "$(cleanDropDown "${SGDBLOGOSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBLOGONSFW')":CBE "$(cleanDropDown "${SGDBLOGONSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBLOGOHUMOR')":CBE "$(cleanDropDown "${SGDBLOGOHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBLOGOEPILEPSY')":CHK "$(cleanDropDown ${SGDBLOGOEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBDLBOXART!$DESC_SGDBDLBOXART ('SGDBDLBOXART')":CHK "${SGDBDLBOXART/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBDIMS!$DESC_SGDBDIMS ('SGDBBOXARTDIMS')":CBE "$(cleanDropDown "${SGDBBOXARTDIMS/#-/ -}" "${DEFSGDBBOXARTDIMS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBBOXARTTYPES')":CBE "$(cleanDropDown "${SGDBBOXARTTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBBOXARTSTYLES')":CBE "$(cleanDropDown "${SGDBBOXARTSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBBOXARTNSFW')":CBE "$(cleanDropDown "${SGDBBOXARTNSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBBOXARTHUMOR')":CBE "$(cleanDropDown "${SGDBBOXARTHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBBOXARTEPILEPSY')":CHK "$(cleanDropDown ${SGDBBOXARTEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBDLTENFOOT!$DESC_SGDBDLTENFOOT ('SGDBDLTENFOOT')":CHK "${SGDBDLTENFOOT/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBDIMS!$DESC_SGDBDIMS ('SGDBTENFOOTDIMS')":CBE "$(cleanDropDown "${SGDBTENFOOTDIMS/#-/ -}" "${DEFSGDBTENFOOTDIMS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBTENFOOTTYPES')":CBE "$(cleanDropDown "${SGDBTENFOOTTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBTENFOOTSTYLES')":CBE "$(cleanDropDown "${SGDBTENFOOTSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBTENFOOTNSFW')":CBE "$(cleanDropDown "${SGDBTENFOOTNSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBTENFOOTHUMOR')":CBE "$(cleanDropDown "${SGDBTENFOOTHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBTENFOOTEPILEPSY')":CHK "$(cleanDropDown ${SGDBTENFOOTEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field="$(spanFont "$GUI_OPTSHMM" "H")":LBL "SKIP" `#CAT_HMM` `#HEAD_HMM` `#MENU_GLOBAL` \ --field=" $GUI_HMMDLVER!$DESC_HMMDLVER ('HMMDLVER')":CB "$(cleanDropDown "${HMMDLVER/#-/ -}" "$HMMSTABLE!$HMMDEV")" `#CAT_HMM` `#MENU_GLOBAL` \ --field=" $GUI_HMMCOMPDATA!$DESC_HMMCOMPDATA ('HMMCOMPDATA')":DIR "${HMMCOMPDATA/#-/ -}" `#CAT_HMM` `#SUB_Directories` `#MENU_GLOBAL` \ From 43b8f1f3b90325188569693e5b29292828924eea Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 19:11:16 +0100 Subject: [PATCH 08/23] SteamGridDB: Cleanup --- steamtinkerlaunch | 50 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 41b89115..9ce1eabb 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231017-3 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231017-4 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -330,8 +330,6 @@ DEFSGDBTENFOOTDIMS="920x430,460x215" SGDBTYPEOPTS="static!animated!static,animated!animated,static" SGDBTAGOPTS="any!true!false" SGDBSTYOPTS="alternate,blurred,white_logo,material,no_logo" -# TODO check where this is used and remove -SGDBDIMOPTS="600x900,342x482,660x930" GETSTAID="99[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]99" STLGAMES="$STLCFGDIR/games" @@ -3034,29 +3032,29 @@ function setDefaultCfgValues { if [ -z "$SGDBDLLOGO" ] ; then SGDBDLLOGO="1"; fi if [ -z "$SGDBDLBOXART" ] ; then SGDBDLBOXART="1"; fi if [ -z "$SGDBDLTENFOOT" ] ; then SGDBDLTENFOOT="1"; fi - if [ -z "$SGDBHERODIMS" ] ; then SGDBHERODIMS="$DEFSGDBHERODIMS" - if [ -z "$SGDBHEROTYPES" ] ; then SGDBHEROTYPES="$SGDBTYPEOPTS" - if [ -z "$SGDBHEROSTYLES" ] ; then SGDBHEROSTYLES="$SGDBSTYOPTS" - if [ -z "$SGDBHERONSFW" ] ; then SGDBHERONSFW="any" - if [ -z "$SGDBHEROHUMOR" ] ; then SGDBHEROHUMOR="any" - if [ -z "$SGDBHEROEPILEPSY" ] ; then SGDBHEROEPILEPSY="false" - if [ -z "$SGDBLOGOTYPES" ] ; then SGDBLOGOTYPES="$SGDBTYPEOPTS" - if [ -z "$SGDBLOGOSTYLES" ] ; then SGDBLOGOSTYLES="$SGDBSTYOPTS" - if [ -z "$SGDBLOGONSFW" ] ; then SGDBLOGONSFW="any" - if [ -z "$SGDBLOGOHUMOR" ] ; then SGDBLOGOHUMOR="any" - if [ -z "$SGDBLOGOEPILEPSY" ] ; then SGDBLOGOEPILEPSY="false" - if [ -z "$SGDBBOXARTDIMS" ] ; then SGDBBOXARTDIMS="$DEFSGDBBOXARTDIMS" - if [ -z "$SGDBBOXARTTYPES" ] ; then SGDBBOXARTTYPES="$SGDBTYPEOPTS" - if [ -z "$SGDBBOXARTSTYLES" ] ; then SGDBBOXARTSTYLES="$SGDBSTYOPTS" - if [ -z "$SGDBBOXARTNSFW" ] ; then SGDBBOXARTNSFW="any" - if [ -z "$SGDBBOXARTHUMOR" ] ; then SGDBBOXARTHUMOR="any" - if [ -z "$SGDBBOXARTEPILEPSY" ] ; then SGDBBOXARTEPILEPSY="false" - if [ -z "$SGDBTENFOOTDIMS" ] ; then SGDBTENFOOTDIMS="$DEFSGDBTENFOOTDIMS" - if [ -z "$SGDBTENFOOTTYPES" ] ; then SGDBTENFOOTTYPES="$SGDBTYPEOPTS" - if [ -z "$SGDBTENFOOTSTYLES" ] ; then SGDBTENFOOTSTYLES="$SGDBSTYOPTS" - if [ -z "$SGDBTENFOOTNSFW" ] ; then SGDBTENFOOTNSFW="any" - if [ -z "$SGDBTENFOOTHUMOR" ] ; then SGDBTENFOOTHUMOR="any" - if [ -z "$SGDBTENFOOTEPILEPSY" ] ; then SGDBTENFOOTEPILEPSY="false" + if [ -z "$SGDBHERODIMS" ] ; then SGDBHERODIMS="$DEFSGDBHERODIMS"; fi + if [ -z "$SGDBHEROTYPES" ] ; then SGDBHEROTYPES="$SGDBTYPEOPTS"; fi + if [ -z "$SGDBHEROSTYLES" ] ; then SGDBHEROSTYLES="$SGDBSTYOPTS"; fi + if [ -z "$SGDBHERONSFW" ] ; then SGDBHERONSFW="any"; fi + if [ -z "$SGDBHEROHUMOR" ] ; then SGDBHEROHUMOR="any"; fi + if [ -z "$SGDBHEROEPILEPSY" ] ; then SGDBHEROEPILEPSY="false"; fi + if [ -z "$SGDBLOGOTYPES" ] ; then SGDBLOGOTYPES="$SGDBTYPEOPTS"; fi + if [ -z "$SGDBLOGOSTYLES" ] ; then SGDBLOGOSTYLES="$SGDBSTYOPTS"; fi + if [ -z "$SGDBLOGONSFW" ] ; then SGDBLOGONSFW="any"; fi + if [ -z "$SGDBLOGOHUMOR" ] ; then SGDBLOGOHUMOR="any"; fi + if [ -z "$SGDBLOGOEPILEPSY" ] ; then SGDBLOGOEPILEPSY="false"; fi + if [ -z "$SGDBBOXARTDIMS" ] ; then SGDBBOXARTDIMS="$DEFSGDBBOXARTDIMS"; fi + if [ -z "$SGDBBOXARTTYPES" ] ; then SGDBBOXARTTYPES="$SGDBTYPEOPTS"; fi + if [ -z "$SGDBBOXARTSTYLES" ] ; then SGDBBOXARTSTYLES="$SGDBSTYOPTS"; fi + if [ -z "$SGDBBOXARTNSFW" ] ; then SGDBBOXARTNSFW="any"; fi + if [ -z "$SGDBBOXARTHUMOR" ] ; then SGDBBOXARTHUMOR="any"; fi + if [ -z "$SGDBBOXARTEPILEPSY" ] ; then SGDBBOXARTEPILEPSY="false"; fi + if [ -z "$SGDBTENFOOTDIMS" ] ; then SGDBTENFOOTDIMS="$DEFSGDBTENFOOTDIMS"; fi + if [ -z "$SGDBTENFOOTTYPES" ] ; then SGDBTENFOOTTYPES="$SGDBTYPEOPTS"; fi + if [ -z "$SGDBTENFOOTSTYLES" ] ; then SGDBTENFOOTSTYLES="$SGDBSTYOPTS"; fi + if [ -z "$SGDBTENFOOTNSFW" ] ; then SGDBTENFOOTNSFW="any"; fi + if [ -z "$SGDBTENFOOTHUMOR" ] ; then SGDBTENFOOTHUMOR="any"; fi + if [ -z "$SGDBTENFOOTEPILEPSY" ] ; then SGDBTENFOOTEPILEPSY="false"; fi if [ -z "$STORECOMPDATTITLE" ] ; then STORECOMPDATTITLE="1"; fi if [ -z "$CUSTCONTY" ] ; then CUSTCONTY="$NON"; fi if [ -z "$UPDATECONTY" ] ; then UPDATECONTY="1"; fi From 0d56eff2715964a6ab7a88e067c8a608f06977f4 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 19:16:16 +0100 Subject: [PATCH 09/23] SteamGridDB: Fix epilepsy option using wrong UI element --- steamtinkerlaunch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 9ce1eabb..988ca8c7 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231017-4 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231017-5 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -5522,27 +5522,27 @@ function AllSettingsEntriesDummyFunction { --field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBHEROSTYLES')":CBE "$(cleanDropDown "${SGDBHEROSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBHERONSFW')":CBE "$(cleanDropDown "${SGDBHERONSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBHEROHUMOR')":CBE "$(cleanDropDown "${SGDBHEROHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBHEROEPILEPSY')":CHK "$(cleanDropDown ${SGDBHEROEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBHEROEPILEPSY')":CBE "$(cleanDropDown ${SGDBHEROEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDLLOGO!$DESC_SGDBDLLOGO ('SGDBDLLOGO')":CHK "${SGDBDLLOGO/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBLOGOTYPES')":CBE "$(cleanDropDown "${SGDBLOGOTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBLOGOSTYLES')":CBE "$(cleanDropDown "${SGDBLOGOSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBLOGONSFW')":CBE "$(cleanDropDown "${SGDBLOGONSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBLOGOHUMOR')":CBE "$(cleanDropDown "${SGDBLOGOHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBLOGOEPILEPSY')":CHK "$(cleanDropDown ${SGDBLOGOEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBLOGOEPILEPSY')":CBE "$(cleanDropDown ${SGDBLOGOEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDLBOXART!$DESC_SGDBDLBOXART ('SGDBDLBOXART')":CHK "${SGDBDLBOXART/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDIMS!$DESC_SGDBDIMS ('SGDBBOXARTDIMS')":CBE "$(cleanDropDown "${SGDBBOXARTDIMS/#-/ -}" "${DEFSGDBBOXARTDIMS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBBOXARTTYPES')":CBE "$(cleanDropDown "${SGDBBOXARTTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBBOXARTSTYLES')":CBE "$(cleanDropDown "${SGDBBOXARTSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBBOXARTNSFW')":CBE "$(cleanDropDown "${SGDBBOXARTNSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBBOXARTHUMOR')":CBE "$(cleanDropDown "${SGDBBOXARTHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBBOXARTEPILEPSY')":CHK "$(cleanDropDown ${SGDBBOXARTEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBBOXARTEPILEPSY')":CBE "$(cleanDropDown ${SGDBBOXARTEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDLTENFOOT!$DESC_SGDBDLTENFOOT ('SGDBDLTENFOOT')":CHK "${SGDBDLTENFOOT/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDIMS!$DESC_SGDBDIMS ('SGDBTENFOOTDIMS')":CBE "$(cleanDropDown "${SGDBTENFOOTDIMS/#-/ -}" "${DEFSGDBTENFOOTDIMS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBTENFOOTTYPES')":CBE "$(cleanDropDown "${SGDBTENFOOTTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBTENFOOTSTYLES')":CBE "$(cleanDropDown "${SGDBTENFOOTSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBTENFOOTNSFW')":CBE "$(cleanDropDown "${SGDBTENFOOTNSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBTENFOOTHUMOR')":CBE "$(cleanDropDown "${SGDBTENFOOTHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBTENFOOTEPILEPSY')":CHK "$(cleanDropDown ${SGDBTENFOOTEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBTENFOOTEPILEPSY')":CBE "$(cleanDropDown ${SGDBTENFOOTEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field="$(spanFont "$GUI_OPTSHMM" "H")":LBL "SKIP" `#CAT_HMM` `#HEAD_HMM` `#MENU_GLOBAL` \ --field=" $GUI_HMMDLVER!$DESC_HMMDLVER ('HMMDLVER')":CB "$(cleanDropDown "${HMMDLVER/#-/ -}" "$HMMSTABLE!$HMMDEV")" `#CAT_HMM` `#MENU_GLOBAL` \ --field=" $GUI_HMMCOMPDATA!$DESC_HMMCOMPDATA ('HMMCOMPDATA')":DIR "${HMMCOMPDATA/#-/ -}" `#CAT_HMM` `#SUB_Directories` `#MENU_GLOBAL` \ From 461339b99e0d731fd20503d8ce4f4679dfaa958e Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 19:39:04 +0100 Subject: [PATCH 10/23] SteamGridDB: Fix endpoint call and default prefs values --- steamtinkerlaunch | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 988ca8c7..b36c245a 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231017-5 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231017-7 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -1407,28 +1407,30 @@ function downloadArtFromSteamGridDB { FORCESGDBDLTOSTEAM="${11}" # Option to force downloading artwork to Steam Grid folder - SGDB_ENDPOINT_STR="${SEARCHENDPOINT}/$(echo "$SEARCHID" | awk '{print $1}' | paste -s -d, -)" + SGDB_ENDPOINT_STR="${SEARCHENDPOINT}/$(echo "$SEARCHID" | awk '{print $1}' | paste -s -d, -)?" # Only include query params if provided # e.g.: "?styles=${SEARCHSTYLES}&dimensions=${SEARCHDIMS}&types=${SGDBTYPES}&nsfw=${SEARCHNSFW}&humor=${SEARCHHUMOR}" if [ -n "$SEARCHSTYLES" ]; then - SGDB_ENDPOINT_STR+="?styles=${SEARCHSTYLES}" + SGDB_ENDPOINT_STR+="&styles=${SEARCHSTYLES}" fi if [ -n "$SEARCHDIMS" ]; then - SGDB_ENDPOINT_STR+="?dimensions=${SEARCHDIMS}" + SGDB_ENDPOINT_STR+="&dimensions=${SEARCHDIMS}" fi if [ -n "$SEARCHTYPES" ]; then - SGDB_ENDPOINT_STR+="?types=${SEARCHTYPES}" + SGDB_ENDPOINT_STR+="&types=${SEARCHTYPES}" fi if [ -n "$SEARCHNSFW" ]; then - SGDB_ENDPOINT_STR+="?nsfw=${SEARCHNSFW}" + SGDB_ENDPOINT_STR+="&nsfw=${SEARCHNSFW}" fi if [ -n "$SEARCHHUMOR" ]; then - SGDB_ENDPOINT_STR+="?humor=${SEARCHHUMOR}" + SGDB_ENDPOINT_STR+="&humor=${SEARCHHUMOR}" fi if [ -n "$SEARCHEPILEPSY" ]; then - SGDB_ENDPOINT_STR+="?epilepsy=${SEARCHEPILEPSY}" + SGDB_ENDPOINT_STR+="&epilepsy=${SEARCHEPILEPSY}" fi + writelog "INFO" "${FUNCNAME[0]} - Outgoing SteamGridDB endpoint is: $SGDB_ENDPOINT_STR" + # If the whole batch has no grids we get a 404 and wget gives an error. --content-on-error ensures we still get the response json and the following logic still works RESPONSE="$("$WGET" --content-on-error --header="Authorization: Bearer $SGDBAPIKEY" -q "$SGDB_ENDPOINT_STR" -O - 2> >(grep -v "SSL_INIT"))" @@ -3033,24 +3035,24 @@ function setDefaultCfgValues { if [ -z "$SGDBDLBOXART" ] ; then SGDBDLBOXART="1"; fi if [ -z "$SGDBDLTENFOOT" ] ; then SGDBDLTENFOOT="1"; fi if [ -z "$SGDBHERODIMS" ] ; then SGDBHERODIMS="$DEFSGDBHERODIMS"; fi - if [ -z "$SGDBHEROTYPES" ] ; then SGDBHEROTYPES="$SGDBTYPEOPTS"; fi + if [ -z "$SGDBHEROTYPES" ] ; then SGDBHEROTYPES="static"; fi if [ -z "$SGDBHEROSTYLES" ] ; then SGDBHEROSTYLES="$SGDBSTYOPTS"; fi if [ -z "$SGDBHERONSFW" ] ; then SGDBHERONSFW="any"; fi if [ -z "$SGDBHEROHUMOR" ] ; then SGDBHEROHUMOR="any"; fi if [ -z "$SGDBHEROEPILEPSY" ] ; then SGDBHEROEPILEPSY="false"; fi - if [ -z "$SGDBLOGOTYPES" ] ; then SGDBLOGOTYPES="$SGDBTYPEOPTS"; fi + if [ -z "$SGDBLOGOTYPES" ] ; then SGDBLOGOTYPES="static"; fi if [ -z "$SGDBLOGOSTYLES" ] ; then SGDBLOGOSTYLES="$SGDBSTYOPTS"; fi if [ -z "$SGDBLOGONSFW" ] ; then SGDBLOGONSFW="any"; fi if [ -z "$SGDBLOGOHUMOR" ] ; then SGDBLOGOHUMOR="any"; fi if [ -z "$SGDBLOGOEPILEPSY" ] ; then SGDBLOGOEPILEPSY="false"; fi if [ -z "$SGDBBOXARTDIMS" ] ; then SGDBBOXARTDIMS="$DEFSGDBBOXARTDIMS"; fi - if [ -z "$SGDBBOXARTTYPES" ] ; then SGDBBOXARTTYPES="$SGDBTYPEOPTS"; fi + if [ -z "$SGDBBOXARTTYPES" ] ; then SGDBBOXARTTYPES="static"; fi if [ -z "$SGDBBOXARTSTYLES" ] ; then SGDBBOXARTSTYLES="$SGDBSTYOPTS"; fi if [ -z "$SGDBBOXARTNSFW" ] ; then SGDBBOXARTNSFW="any"; fi if [ -z "$SGDBBOXARTHUMOR" ] ; then SGDBBOXARTHUMOR="any"; fi if [ -z "$SGDBBOXARTEPILEPSY" ] ; then SGDBBOXARTEPILEPSY="false"; fi if [ -z "$SGDBTENFOOTDIMS" ] ; then SGDBTENFOOTDIMS="$DEFSGDBTENFOOTDIMS"; fi - if [ -z "$SGDBTENFOOTTYPES" ] ; then SGDBTENFOOTTYPES="$SGDBTYPEOPTS"; fi + if [ -z "$SGDBTENFOOTTYPES" ] ; then SGDBTENFOOTTYPES="static"; fi if [ -z "$SGDBTENFOOTSTYLES" ] ; then SGDBTENFOOTSTYLES="$SGDBSTYOPTS"; fi if [ -z "$SGDBTENFOOTNSFW" ] ; then SGDBTENFOOTNSFW="any"; fi if [ -z "$SGDBTENFOOTHUMOR" ] ; then SGDBTENFOOTHUMOR="any"; fi From 5e5e5b051f9f3f24ce3ecfb625cd37385dcbd2de Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 19:43:59 +0100 Subject: [PATCH 11/23] SteamGridDB: Use correct style for each artwork type --- steamtinkerlaunch | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index b36c245a..5f523e78 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231017-7 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231017-8 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -329,7 +329,9 @@ DEFSGDBBOXARTDIMS="600x900" DEFSGDBTENFOOTDIMS="920x430,460x215" SGDBTYPEOPTS="static!animated!static,animated!animated,static" SGDBTAGOPTS="any!true!false" -SGDBSTYOPTS="alternate,blurred,white_logo,material,no_logo" +SGDBHEROSTYLEOPTS="alternate,blurred,material" +SGDBLOGOSTYLEOPTS="official,white,black,custom" +SGDBGRIDSTYLEOPTS="alternate,blurred,white_logo,material,no_logo" GETSTAID="99[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]99" STLGAMES="$STLCFGDIR/games" @@ -3036,24 +3038,24 @@ function setDefaultCfgValues { if [ -z "$SGDBDLTENFOOT" ] ; then SGDBDLTENFOOT="1"; fi if [ -z "$SGDBHERODIMS" ] ; then SGDBHERODIMS="$DEFSGDBHERODIMS"; fi if [ -z "$SGDBHEROTYPES" ] ; then SGDBHEROTYPES="static"; fi - if [ -z "$SGDBHEROSTYLES" ] ; then SGDBHEROSTYLES="$SGDBSTYOPTS"; fi + if [ -z "$SGDBHEROSTYLES" ] ; then SGDBHEROSTYLES="$SGDBHEROSTYLEOPTS"; fi if [ -z "$SGDBHERONSFW" ] ; then SGDBHERONSFW="any"; fi if [ -z "$SGDBHEROHUMOR" ] ; then SGDBHEROHUMOR="any"; fi if [ -z "$SGDBHEROEPILEPSY" ] ; then SGDBHEROEPILEPSY="false"; fi if [ -z "$SGDBLOGOTYPES" ] ; then SGDBLOGOTYPES="static"; fi - if [ -z "$SGDBLOGOSTYLES" ] ; then SGDBLOGOSTYLES="$SGDBSTYOPTS"; fi + if [ -z "$SGDBLOGOSTYLES" ] ; then SGDBLOGOSTYLES="$SGDBLOGOSTYLEOPTS"; fi if [ -z "$SGDBLOGONSFW" ] ; then SGDBLOGONSFW="any"; fi if [ -z "$SGDBLOGOHUMOR" ] ; then SGDBLOGOHUMOR="any"; fi if [ -z "$SGDBLOGOEPILEPSY" ] ; then SGDBLOGOEPILEPSY="false"; fi if [ -z "$SGDBBOXARTDIMS" ] ; then SGDBBOXARTDIMS="$DEFSGDBBOXARTDIMS"; fi if [ -z "$SGDBBOXARTTYPES" ] ; then SGDBBOXARTTYPES="static"; fi - if [ -z "$SGDBBOXARTSTYLES" ] ; then SGDBBOXARTSTYLES="$SGDBSTYOPTS"; fi + if [ -z "$SGDBBOXARTSTYLES" ] ; then SGDBBOXARTSTYLES="$SGDBGRIDSTYLEOPTS"; fi if [ -z "$SGDBBOXARTNSFW" ] ; then SGDBBOXARTNSFW="any"; fi if [ -z "$SGDBBOXARTHUMOR" ] ; then SGDBBOXARTHUMOR="any"; fi if [ -z "$SGDBBOXARTEPILEPSY" ] ; then SGDBBOXARTEPILEPSY="false"; fi if [ -z "$SGDBTENFOOTDIMS" ] ; then SGDBTENFOOTDIMS="$DEFSGDBTENFOOTDIMS"; fi if [ -z "$SGDBTENFOOTTYPES" ] ; then SGDBTENFOOTTYPES="static"; fi - if [ -z "$SGDBTENFOOTSTYLES" ] ; then SGDBTENFOOTSTYLES="$SGDBSTYOPTS"; fi + if [ -z "$SGDBTENFOOTSTYLES" ] ; then SGDBTENFOOTSTYLES="$SGDBGRIDSTYLEOPTS"; fi if [ -z "$SGDBTENFOOTNSFW" ] ; then SGDBTENFOOTNSFW="any"; fi if [ -z "$SGDBTENFOOTHUMOR" ] ; then SGDBTENFOOTHUMOR="any"; fi if [ -z "$SGDBTENFOOTEPILEPSY" ] ; then SGDBTENFOOTEPILEPSY="false"; fi @@ -5521,27 +5523,27 @@ function AllSettingsEntriesDummyFunction { --field=" $GUI_SGDBDLHERO!$DESC_SGDBDLHERO ('SGDBDLHERO')":CHK "${SGDBDLHERO/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDIMS!$DESC_SGDBDIMS ('SGDBHERODIMS')":CBE "$(cleanDropDown "${SGDBHERODIMS/#-/ -}" "${DEFSGDBHERODIMS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBHEROTYPES')":CBE "$(cleanDropDown "${SGDBHEROTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBHEROSTYLES')":CBE "$(cleanDropDown "${SGDBHEROSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBHEROSTYLES')":CBE "$(cleanDropDown "${SGDBHEROSTYLES/#-/ -}" "${SGDBHEROSTYLEOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBHERONSFW')":CBE "$(cleanDropDown "${SGDBHERONSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBHEROHUMOR')":CBE "$(cleanDropDown "${SGDBHEROHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBHEROEPILEPSY')":CBE "$(cleanDropDown ${SGDBHEROEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDLLOGO!$DESC_SGDBDLLOGO ('SGDBDLLOGO')":CHK "${SGDBDLLOGO/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBLOGOTYPES')":CBE "$(cleanDropDown "${SGDBLOGOTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBLOGOSTYLES')":CBE "$(cleanDropDown "${SGDBLOGOSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBLOGOSTYLES')":CBE "$(cleanDropDown "${SGDBLOGOSTYLES/#-/ -}" "${SGDBLOGOSTYLEOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBLOGONSFW')":CBE "$(cleanDropDown "${SGDBLOGONSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBLOGOHUMOR')":CBE "$(cleanDropDown "${SGDBLOGOHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBLOGOEPILEPSY')":CBE "$(cleanDropDown ${SGDBLOGOEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDLBOXART!$DESC_SGDBDLBOXART ('SGDBDLBOXART')":CHK "${SGDBDLBOXART/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDIMS!$DESC_SGDBDIMS ('SGDBBOXARTDIMS')":CBE "$(cleanDropDown "${SGDBBOXARTDIMS/#-/ -}" "${DEFSGDBBOXARTDIMS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBBOXARTTYPES')":CBE "$(cleanDropDown "${SGDBBOXARTTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBBOXARTSTYLES')":CBE "$(cleanDropDown "${SGDBBOXARTSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBBOXARTSTYLES')":CBE "$(cleanDropDown "${SGDBBOXARTSTYLES/#-/ -}" "${SGDBGRIDSTYLEOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBBOXARTNSFW')":CBE "$(cleanDropDown "${SGDBBOXARTNSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBBOXARTHUMOR')":CBE "$(cleanDropDown "${SGDBBOXARTHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBBOXARTEPILEPSY')":CBE "$(cleanDropDown ${SGDBBOXARTEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDLTENFOOT!$DESC_SGDBDLTENFOOT ('SGDBDLTENFOOT')":CHK "${SGDBDLTENFOOT/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDIMS!$DESC_SGDBDIMS ('SGDBTENFOOTDIMS')":CBE "$(cleanDropDown "${SGDBTENFOOTDIMS/#-/ -}" "${DEFSGDBTENFOOTDIMS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBTENFOOTTYPES')":CBE "$(cleanDropDown "${SGDBTENFOOTTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBTENFOOTSTYLES')":CBE "$(cleanDropDown "${SGDBTENFOOTSTYLES/#-/ -}" "${SGDBSTYOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBTENFOOTSTYLES')":CBE "$(cleanDropDown "${SGDBTENFOOTSTYLES/#-/ -}" "${SGDBGRIDSTYLEOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBTENFOOTNSFW')":CBE "$(cleanDropDown "${SGDBTENFOOTNSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBTENFOOTHUMOR')":CBE "$(cleanDropDown "${SGDBTENFOOTHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBTENFOOTEPILEPSY')":CBE "$(cleanDropDown ${SGDBTENFOOTEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ From d2ebc2b1637e92c69cd51c1c3b03e7a2bc6900d0 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 20:16:42 +0100 Subject: [PATCH 12/23] SteamGridDB: Use correct dimensions for hero artwork --- steamtinkerlaunch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 5f523e78..13c8c45c 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -324,7 +324,7 @@ APIN="appinfo" SLO="Steam Launch Option" SOMEPOPULARWINEPAKS="dotnet4 quartz xact" SOMEWINEDEBUGOPTIONS="-all,+steam,+vrclient,+vulkan" -DEFSGDBHERODIMS="3840x1240,1280x620" +DEFSGDBHERODIMS="3840x1240,1920x620" DEFSGDBBOXARTDIMS="600x900" DEFSGDBTENFOOTDIMS="920x430,460x215" SGDBTYPEOPTS="static!animated!static,animated!animated,static" From 99cfe296e816458a6a7dc5137dcf47af613b44f7 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 20:17:55 +0100 Subject: [PATCH 13/23] version bump --- steamtinkerlaunch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 13c8c45c..9e344cd7 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231017-8 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231017-9 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" From b6638ce1b1655cc5e70b4e51d21156bbef150eab Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 20:25:52 +0100 Subject: [PATCH 14/23] SteamGridDB: Remove no_logo from tenfoot --- steamtinkerlaunch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 9e344cd7..77602005 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231017-9 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231017-10 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -332,6 +332,7 @@ SGDBTAGOPTS="any!true!false" SGDBHEROSTYLEOPTS="alternate,blurred,material" SGDBLOGOSTYLEOPTS="official,white,black,custom" SGDBGRIDSTYLEOPTS="alternate,blurred,white_logo,material,no_logo" +SGDBTNFTSTYLEOPTS="alternate,blurred,white_logo,material" GETSTAID="99[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]99" STLGAMES="$STLCFGDIR/games" @@ -3055,7 +3056,7 @@ function setDefaultCfgValues { if [ -z "$SGDBBOXARTEPILEPSY" ] ; then SGDBBOXARTEPILEPSY="false"; fi if [ -z "$SGDBTENFOOTDIMS" ] ; then SGDBTENFOOTDIMS="$DEFSGDBTENFOOTDIMS"; fi if [ -z "$SGDBTENFOOTTYPES" ] ; then SGDBTENFOOTTYPES="static"; fi - if [ -z "$SGDBTENFOOTSTYLES" ] ; then SGDBTENFOOTSTYLES="$SGDBGRIDSTYLEOPTS"; fi + if [ -z "$SGDBTENFOOTSTYLES" ] ; then SGDBTENFOOTSTYLES="$SGDBTNFTSTYLEOPTS"; fi if [ -z "$SGDBTENFOOTNSFW" ] ; then SGDBTENFOOTNSFW="any"; fi if [ -z "$SGDBTENFOOTHUMOR" ] ; then SGDBTENFOOTHUMOR="any"; fi if [ -z "$SGDBTENFOOTEPILEPSY" ] ; then SGDBTENFOOTEPILEPSY="false"; fi @@ -5543,7 +5544,7 @@ function AllSettingsEntriesDummyFunction { --field=" $GUI_SGDBDLTENFOOT!$DESC_SGDBDLTENFOOT ('SGDBDLTENFOOT')":CHK "${SGDBDLTENFOOT/#-/ -}" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBDIMS!$DESC_SGDBDIMS ('SGDBTENFOOTDIMS')":CBE "$(cleanDropDown "${SGDBTENFOOTDIMS/#-/ -}" "${DEFSGDBTENFOOTDIMS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBTYPES!$DESC_SGDBTYPES ('SGDBTENFOOTTYPES')":CBE "$(cleanDropDown "${SGDBTENFOOTTYPES/#-/ -}" "${SGDBTYPEOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ ---field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBTENFOOTSTYLES')":CBE "$(cleanDropDown "${SGDBTENFOOTSTYLES/#-/ -}" "${SGDBGRIDSTYLEOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ +--field=" $GUI_SGDBSTYLES!$DESC_SGDBSTYLES ('SGDBTENFOOTSTYLES')":CBE "$(cleanDropDown "${SGDBTENFOOTSTYLES/#-/ -}" "${SGDBTNFTSTYLEOPTS//,/\!}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBNSFW!$DESC_SGDBNSFW ('SGDBTENFOOTNSFW')":CBE "$(cleanDropDown "${SGDBTENFOOTNSFW/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBHUMOR!$DESC_SGDBHUMOR ('SGDBTENFOOTHUMOR')":CBE "$(cleanDropDown "${SGDBTENFOOTHUMOR/#-/ -}" "${SGDBTAGOPTS}")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ --field=" $GUI_SGDBEPILEPSY!$DESC_SGDBEPILEPSY ('SGDBTENFOOTEPILEPSY')":CBE "$(cleanDropDown ${SGDBTENFOOTEPILEPSY/#-/ -} "$SGDBTAGOPTS")" `#CAT_SteamGridDB` `#MENU_GLOBAL` \ From d4aa93de2d14fe2a037b1e05874ea3cccd60300c Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 21:04:32 +0100 Subject: [PATCH 15/23] SteamGridDB: Initial logic for fetching icons for adding Non-Steam Games --- steamtinkerlaunch | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 77602005..aadc4b25 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -23331,6 +23331,26 @@ function addNonSteamGame { fi } + # Download icon for Non-Steam Game using SteamGridDB Game ID + # We can't set icons for Steam games, and right now we can't edit the `shortcuts.vdf` file to edit the path to the icon, + # so this function is only for Non-Steam Games and only when they're being added to Steam + # + # In future, if we have a function to add SteamGridDB art for all Non-Steam Games, we could break this out and use it to set icons at that time too + function getSteamGridDBNonSteamIcon { + NOSTICONAID="$1" # Non-Steam AppID + NOSTSGDBID="$2" # SteamGridDB Game ID + SGDBSEARCHENDPOINT_ICONS="${BASESTEAMGRIDDBAPI}/icons/game" + + # Download icon and put it in Steam grids folder, which should be a safe and intuitive location + # We don't have any way to set search settings for icons and it would be confusing to have this in the Global Menu for now, so just leave blank + # In future if we have Non-Steam Game global settings, we could include icon settings there too + downloadArtFromSteamGridDB "$NOSTSGDBID" "$SGDBSEARCHENDPOINT_ICONS" "${NOSTICONAID}_icon" "" "" "" "" "" "" "replace" "1" + + # Return icon path + # note that if we add an option to choose the Steam user to add the shortcut for, this will be impacted + echo "$STUIDPATH/config/grid/${NOSTICONAID}_icon" + } + NOSTHIDE=0 # Does hide still work? Didn't seem to in my tests NOSTADC=1 NOSTAO=1 @@ -23521,13 +23541,16 @@ function addNonSteamGame { NOSTICONPATH="$( findGameArtInExeDir "$NOSTEXEBASEDIR" "icon" "$NOSTICONPATH" )" fi - # TODO support icons from SteamGridDB (these have to be written to the VDF file, how can we save and set these?) - # We could do this by making a separate "downloadArtFromSteamGridDB" call and saving the icon to the grids folder, then copying that path and using it when we're writing out the icon (i.e set the value of "NOSTICONPATH" if the icon file was successfully found on SteamGridDB) - # Maybe we could make a dedicated function for getting icons? + ## Fetch artwork from SteamGridDB if [ "$NOSTUSESGDB" -eq 1 ]; then - # SteamGridDB ID and Non-Steam Game AppID, respectively - # getGridsForNonSteamGame "$NOSTSGDBGAMEID" "$NOSTAIDGRID" + # Regular artwork commandlineGetSteamGridDBArtwork --search-id="$NOSTSGDBGAMEID" --filename-appid="$NOSTAIDGRID" --nonsteam + + # Icon -- Only set if we successfully download an icon from SteamGridDB + NOSTSGDBICON="$( getSteamGridDBNonSteamIcon "$NOSTAIDGRID" "$NOSTSGDBGAMEID" )" + if [ -f "$NOSTSGDBICON" ]; then + NOSTICONPATH="$NOSTSGDBICON" + fi fi writelog "INFO" "${FUNCNAME[0]} - Adding new set '$NEWSET'" From 8a8c92b1c34c8f0f4065c18bb74bda835c97ce63 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 21:34:07 +0100 Subject: [PATCH 16/23] SteamGridDB: Fetch icons for Non-Steam Games --- steamtinkerlaunch | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index aadc4b25..3b5780a3 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231017-10 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231017-11 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -23339,16 +23339,18 @@ function addNonSteamGame { function getSteamGridDBNonSteamIcon { NOSTICONAID="$1" # Non-Steam AppID NOSTSGDBID="$2" # SteamGridDB Game ID + NOSTICONNAME="${NOSTICONAID}_icon" SGDBSEARCHENDPOINT_ICONS="${BASESTEAMGRIDDBAPI}/icons/game" # Download icon and put it in Steam grids folder, which should be a safe and intuitive location # We don't have any way to set search settings for icons and it would be confusing to have this in the Global Menu for now, so just leave blank # In future if we have Non-Steam Game global settings, we could include icon settings there too - downloadArtFromSteamGridDB "$NOSTSGDBID" "$SGDBSEARCHENDPOINT_ICONS" "${NOSTICONAID}_icon" "" "" "" "" "" "" "replace" "1" + downloadArtFromSteamGridDB "$NOSTSGDBID" "$SGDBSEARCHENDPOINT_ICONS" "${NOSTICONNAME}" "" "" "" "" "" "" "replace" "1" # Return icon path # note that if we add an option to choose the Steam user to add the shortcut for, this will be impacted - echo "$STUIDPATH/config/grid/${NOSTICONAID}_icon" + # NOSTICONPATH="$STUIDPATH/config/grid/" + # find "$NOSTICONPATH" -name "${NOSTICONNAME}.*" | head -n1 2>/dev/null } NOSTHIDE=0 # Does hide still work? Didn't seem to in my tests @@ -23542,14 +23544,19 @@ function addNonSteamGame { fi ## Fetch artwork from SteamGridDB + # TODO notifier if [ "$NOSTUSESGDB" -eq 1 ]; then # Regular artwork - commandlineGetSteamGridDBArtwork --search-id="$NOSTSGDBGAMEID" --filename-appid="$NOSTAIDGRID" --nonsteam + commandlineGetSteamGridDBArtwork --search-id="$NOSTSGDBGAMEID" --filename-appid="$NOSTAIDGRID" --nonsteam --apply --replace-existing # Icon -- Only set if we successfully download an icon from SteamGridDB - NOSTSGDBICON="$( getSteamGridDBNonSteamIcon "$NOSTAIDGRID" "$NOSTSGDBGAMEID" )" + getSteamGridDBNonSteamIcon "$NOSTAIDGRID" "$NOSTSGDBGAMEID" + NOSTSGDBICON="$( find "${STUIDPATH}/config/grid/" -name "${NOSTAIDGRID}_icon.*" | head -n1 2>/dev/null )" if [ -f "$NOSTSGDBICON" ]; then + writelog "INFO" "${FUNCNAME[0]} - Found SteamGridDB icon path to '$NOSTSGDBICON' -- Using this as Non-Steam Game Icon" NOSTICONPATH="$NOSTSGDBICON" + else + writelog "INFO" "${FUNCNAME[0]} - Icon path does not exist at '$NOSTSGDBICON' - Maybe download failed?" fi fi From 3118b6b745ef525ef3ff77681f22f5c7e48bdc30 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 23:06:44 +0100 Subject: [PATCH 17/23] SteamGridDB: Add notifier for Non-Steam Game Artwork fetching --- lang/english.txt | 2 ++ steamtinkerlaunch | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lang/english.txt b/lang/english.txt index d4cdeee7..6f60d65b 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -1251,3 +1251,5 @@ GUI_SGDBDLTENFOOT="Download Tenfoot" DESC_SGDBDLTENFOOT="enable downloading Tenfoot (Horizontal grid) artwork from SteamGridDB" GUI_SGDBEPILEPSY="Epilepsy" DESC_SGDBEPILEPSY="epilepsy options" +NOTY_SGDBDL="Downloading artwork from SteamGridDB" +NOTY_SGDBDLDONE="Finished downloading artwork from SteamGridDB" diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 3b5780a3..d87369c7 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231017-11 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231017-12 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -1445,6 +1445,7 @@ function downloadArtFromSteamGridDB { RESPONSE_LENGTH=$("$JQ" '.data | length' <<< "$RESPONSE") if [ "$RESPONSE_LENGTH" = 0 ]; then writelog "INFO" "${FUNCNAME[0]} - No grid found to download - maybe loosen filters?" + echo "Could not find artwork on SteamGridDB to save with filename '$SGDBFILENAME' -- Check the log for details" fi # TODO: This could be handled by the http return value - 200 is single-part - 207 is multi-part @@ -23346,11 +23347,6 @@ function addNonSteamGame { # We don't have any way to set search settings for icons and it would be confusing to have this in the Global Menu for now, so just leave blank # In future if we have Non-Steam Game global settings, we could include icon settings there too downloadArtFromSteamGridDB "$NOSTSGDBID" "$SGDBSEARCHENDPOINT_ICONS" "${NOSTICONNAME}" "" "" "" "" "" "" "replace" "1" - - # Return icon path - # note that if we add an option to choose the Steam user to add the shortcut for, this will be impacted - # NOSTICONPATH="$STUIDPATH/config/grid/" - # find "$NOSTICONPATH" -name "${NOSTICONNAME}.*" | head -n1 2>/dev/null } NOSTHIDE=0 # Does hide still work? Didn't seem to in my tests @@ -23544,9 +23540,10 @@ function addNonSteamGame { fi ## Fetch artwork from SteamGridDB - # TODO notifier if [ "$NOSTUSESGDB" -eq 1 ]; then # Regular artwork + notiShow "$NOTY_SGDBDL" + commandlineGetSteamGridDBArtwork --search-id="$NOSTSGDBGAMEID" --filename-appid="$NOSTAIDGRID" --nonsteam --apply --replace-existing # Icon -- Only set if we successfully download an icon from SteamGridDB @@ -23558,6 +23555,8 @@ function addNonSteamGame { else writelog "INFO" "${FUNCNAME[0]} - Icon path does not exist at '$NOSTSGDBICON' - Maybe download failed?" fi + + notiShow "$NOTY_SGDBDLDONE" fi writelog "INFO" "${FUNCNAME[0]} - Adding new set '$NEWSET'" From c48add29f125d33ac94a9a952517ea571417cf7f Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 23:14:15 +0100 Subject: [PATCH 18/23] SteamGridDB: Replace getGrids calls with commandlineGetSteamGridDBArtwork --- steamtinkerlaunch | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index d87369c7..72055ef3 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231017-12 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231019-1 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -18462,7 +18462,9 @@ function prepareLaunch { # Automatic Grid Update Check before_game if [ "$SGDBAUTODL" == "before_game" ] && [ "$STLPLAY" -eq 0 ]; then writelog "INFO" "${FUNCNAME[0]} - Automatic Grid Update Check '$SGDBAUTODL'" - getGrids "$AID" & + # TODO replace with commandlineGetSteamGridDBArtwork + # getGrids "$AID" & + commandlineGetSteamGridDBArtwork --search-id="$AID" --steam fi if [ "$ISGAME" -eq 2 ]; then @@ -22089,8 +22091,6 @@ function commandline { getGridsForOwnedGames elif [ "$3" == "installed" ]; then getGridsForInstalledGames - else - getGrids "$3" fi elif [ "$2" == "allgamedata" ]; then getDataForAllGamesinSharedConfig @@ -22366,7 +22366,8 @@ function storeMetaData { if [ ! -f "$GEMETA/$MAID.conf" ]; then if [ "$SGDBAUTODL" == "no_meta" ] ; then writelog "INFO" "${FUNCNAME[0]} - Automatic Grid Update Check '$SGDBAUTODL'" - getGrids "$MAID" + # getGrids "$MAID" + commandlineGetSteamGridDBArtwork --search-id="$MAID" --steam fi touch "$GEMETA/$MAID.conf" fi @@ -23708,7 +23709,9 @@ function closeSTL { if [ "$SGDBAUTODL" == "after_game" ] ; then writelog "INFO" "${FUNCNAME[0]} - Automatic Grid Update Check '$SGDBAUTODL'" - getGrids "$AID" + # TODO replace with commandlineGetSteamGridDBArtwork + # getGrids "$AID" + commandlineGetSteamGridDBArtwork --search-id="$AID" --steam fi if [ "$ISGAME" -eq 2 ] && [ "$PROTON_LOG" -eq 1 ]; then From 84cd4be2067089e9c77544fd2c355316a762cb73 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 23:22:10 +0100 Subject: [PATCH 19/23] SteamGridDB: remove now-unused getGrids --- steamtinkerlaunch | 113 ---------------------------------------------- 1 file changed, 113 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 72055ef3..13e931f4 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -1579,8 +1579,6 @@ function commandlineGetSteamGridDBArtwork { # Download Hero, Logo, Boxart, Tenfoot from SteamGridDB from given endpoint using given AppID # On SteamGridDB, tenfoot is grouped with grids, but as a horizontal Steam grid, so we fetch it by passing specific dimensions matching this # Users are free to override this, but the default is what SteamGridDB expects for the tenfoot sizes - # - # TODO pass values for style,dimension,etc from Global Menu once we have these options (Steam+Non-Steam share same settings) if [ "$SGDBDLHERO" -eq 1 ]; then writelog "INFO" "${FUNCNAME[0]} - Downloading Hero artwork, because SGDBDLHERO is '$SGDBDLHERO'" downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "$SGDBHEROSTYLES" "$SGDBHERODIMS" "$SGDBHEROTYPES" "$SGDBHERONSFW" "$SGDBHEROHUMOR" "$SGDBHEROEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" @@ -1600,115 +1598,6 @@ function commandlineGetSteamGridDBArtwork { fi } - -############################################# - - -# Takes a list of appids separated by newlines -# LEGACY: REPLACE WITH "downloadArtFromSteamGridDB" WHICH IS A GENERIC VERSION OF THIS FOR DOWNLOADING ARTWORK FROM STEAMGRIDDB -function getGrids { - if checkSGDbApi && [ "$STLPLAY" -eq 0 ]; then - LEGACYENDPOINT="$BASESTEAMGRIDDBAPI/grids/steam" - - FORCESGDBDLTOSTEAM="${3:-0}" # Force Non-Steam games to always download to SteamGrid dir - GRIDNAMEAPPIDOVERRIDE="$4" # Override the AppID used for the grid, useful if the ID searched on is not the Steam AppID - - SGDBHASFILE="${5:-SGDBHASFILE}" # Option to override action to take when file already exists - - # Split into batches of 100 games - too many and cloudflare blocks requests because of a too big header file - while mapfile -t -n 100 ary && ((${#ary[@]})); do - PART=$(printf '%s\n' "${ary[@]}") - # If the whole batch has no grids we get a 404 and wget gives an error. --content-on-error ensures we still get the response json and the following logic still works - RESPONSE="$("$WGET" --content-on-error --header="Authorization: Bearer $SGDBAPIKEY" -q "${LEGACYENDPOINT}/$(echo "$PART" | awk '{print $1}' | paste -s -d, -)?styles=${SGDBSTYLES}&dimensions=${SGDBDIMS}&types=${SGDBTYPES}&nsfw=${SGDBNSFW}&humor=${SGDBHUMOR}" -O - 2> >(grep -v "SSL_INIT"))" - - if ! "$JQ" -e '.success' 1> /dev/null <<< "$RESPONSE"; then - writelog "INFO" "${FUNCNAME[0]} - The server response wasn't 'success' for this batch of requested games." - continue - fi - - # catch single grid without downloads - RESPONSE_LENGTH=$("$JQ" '.data | length' <<< "$RESPONSE") - if [ "$RESPONSE_LENGTH" = 0 ]; then - writelog "INFO" "${FUNCNAME[0]} - No grid found to download - maybe loosen filters?" - continue - fi - - # TODO: This could be handled by the http return value - 200 is single-part - 207 is multi-part - # Rewrite response object to fit the following loop if the response isn't multi-part - if "$JQ" -e ".data[0].url" 1> /dev/null <<< "$RESPONSE"; then - RESPONSE="{\"success\":true,\"data\":[$RESPONSE]}" - RESPONSE_LENGTH=1 - fi - - for i in $(seq 0 $(("$RESPONSE_LENGTH" - 1))); do - # match the current json array member against the appid list - # this assumes we get the same order back we put in before - if [ -n "$GRIDNAMEAPPIDOVERRIDE" ]; then - writelog "INFO" "${FUNCNAME[0]} - Overriding SteamGridDB AppID as '$GRIDNAMEAPPIDOVERRIDE'" - APPID="$GRIDNAMEAPPIDOVERRIDE" - else - APPID=$(sed "$((i + 1))q;d" <<< "$PART") - fi - - if ! "$JQ" -e ".data[$i].success" 1> /dev/null <<< "$RESPONSE"; then - writelog "INFO" "${FUNCNAME[0]} - The server response for '$APPID' wasn't 'success'" - continue - fi - if ! URLSTR=$("$JQ" -e -r ".data[$i].data[0].url" <<< "$RESPONSE"); then - writelog "INFO" "${FUNCNAME[0]} - No grid found to download for '$APPID' - maybe loosen filters?" - continue - fi - - GRIDDLURL="${URLSTR//\"}" - if grep -q "^https" <<< "$GRIDDLURL"; then - DLSRC="${GRIDDLURL//\"}" - - if [ "$SGDBDLTOSTEAM" -eq 1 ] || [ "$FORCESGDBDLTOSTEAM" -eq 1 ]; then - if [ -z "$SUSDA" ]; then - setSteamPaths - fi - if [ -d "$SUIC" ]; then - GRIDDLDIR="${SUIC}/grid" - fi - else - GRIDDLDIR="$STLDLDIR/steamgriddb" - fi - - mkProjDir "$GRIDDLDIR" - - DLDST="$GRIDDLDIR/${APPID}p.${GRIDDLURL##*.}" - STARTDL=1 - - if [ -f "$DLDST" ]; then - if [ "$SGDBHASFILE" == "skip" ]; then - writelog "INFO" "${FUNCNAME[0]} - Download of existing file is set to '$SGDBHASFILE' - doing nothing" - STARTDL=0 - elif [ "$SGDBHASFILE" == "backup" ]; then - BACKDIR="${GRIDDLDIR}/backup" - mkProjDir "$BACKDIR" - writelog "INFO" "${FUNCNAME[0]} - Backup existing file into '$BACKDIR', because SGDBHASFILE is set to '$SGDBHASFILE'" - mv "$DLDST" "$BACKDIR" - elif [ "$SGDBHASFILE" == "replace" ]; then - writelog "INFO" "${FUNCNAME[0]} - Replacing existing file '$DLDST', because SGDBHASFILE is set to '$SGDBHASFILE'" - rm "$DLDST" 2>/dev/null - fi - fi - - if [ "$STARTDL" -eq 1 ]; then - dlCheck "$DLSRC" "$DLDST" "X" "Downloading '$DLSRC' to '$DLDST'" - fi - else - writelog "INFO" "${FUNCNAME[0]} - No grid found to download for '$APPID' - maybe loosen filters?" - fi - done - done <<< "${1}" - fi -} - - -############################################# - - function getGridsForOwnedGames { if checkSGDbApi; then getSteamGridDBArtwork "$(getOwnedAids)" @@ -18462,7 +18351,6 @@ function prepareLaunch { # Automatic Grid Update Check before_game if [ "$SGDBAUTODL" == "before_game" ] && [ "$STLPLAY" -eq 0 ]; then writelog "INFO" "${FUNCNAME[0]} - Automatic Grid Update Check '$SGDBAUTODL'" - # TODO replace with commandlineGetSteamGridDBArtwork # getGrids "$AID" & commandlineGetSteamGridDBArtwork --search-id="$AID" --steam fi @@ -23709,7 +23597,6 @@ function closeSTL { if [ "$SGDBAUTODL" == "after_game" ] ; then writelog "INFO" "${FUNCNAME[0]} - Automatic Grid Update Check '$SGDBAUTODL'" - # TODO replace with commandlineGetSteamGridDBArtwork # getGrids "$AID" commandlineGetSteamGridDBArtwork --search-id="$AID" --steam fi From 9062371e3c126550e2775d83cba9bb4f83ace272 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Mon, 16 Oct 2023 23:51:52 +0100 Subject: [PATCH 20/23] minor todo cleanup --- steamtinkerlaunch | 1 - 1 file changed, 1 deletion(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 13e931f4..e3bf7ed5 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -1388,7 +1388,6 @@ function checkSGDbApi { } ## Generic function to fetch some artwork from SteamGridDB based on an endpoint -## TODO: Replace all instances of getGrid with this (some functions can just call this standalone with hardcoded endpoint) ## TODO: Steam only officially supports PNGs, test to see if WebP works when manually copied, and if it doesn't, we should try to only download PNG files ## TODO: Add max filesize option? Some artworks are really big, we should skip ones that are too large (though this may mean many animated APNG artworks will get skipped, because APNG can be huge) function downloadArtFromSteamGridDB { From 232103ccb306973583d5ec0a75b6c7c9d9ca7208 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Tue, 17 Oct 2023 17:03:48 +0100 Subject: [PATCH 21/23] SteamGridDB: Refactor how STL picks game show pic --- steamtinkerlaunch | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index e3bf7ed5..27aa9be7 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231019-1 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231019-3 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -1530,7 +1530,7 @@ function getSteamGridDBArtwork { # # This function can be used on the commandline or just when we want to search for a game by Game ID function commandlineGetSteamGridDBArtwork { - SGDBENDPOINTTYPE="game" + SGDBENDPOINTTYPE="steam" GSGDBA_HASFILE="$SGDBHASFILE" # Optional override for how to handle if file already exists (downloadArtFromSteamGridDB defaults to '$SGDBHASFILE') GSGDBA_APPLYARTWORK="0" for i in "${@}"; do @@ -1573,7 +1573,6 @@ function commandlineGetSteamGridDBArtwork { # TODO # - Consider making --steam the default - # - Consider making --apply the default, and having --no-apply as the explicit option # Download Hero, Logo, Boxart, Tenfoot from SteamGridDB from given endpoint using given AppID # On SteamGridDB, tenfoot is grouped with grids, but as a horizontal Steam grid, so we fetch it by passing specific dimensions matching this @@ -4419,12 +4418,6 @@ function setShowPic { if [ "$STLPLAY" -eq 1 ] && [ -f "$STLGPNG/${AID}.png" ]; then SHOWPIC="$STLGPNG/${AID}.png" - elif [ -n "$GRIDBANNER" ]; then - # Find custom image in grid folder and store resized image at '$STLGHEADD/' - writelog "INFO" "${FUNCNAME[0]} - Using hero image found in Steam Grid folder - '$GRIDBANNER'" - CUSTPIC="$GRIDBANNER" - "$CONVERT" "$CUSTPIC" -resize "460x215!" "$STLGHEADD/${AID}.png" - SHOWPIC="$STLGHEADD/${AID}.png" elif [ "$USEGAMEPICS" -eq 1 ]; then writelog "INFO" "${FUNCNAME[0]} - Determining game picture" if [ -s "$STLGHEADD/$AID.jpg" ]; then @@ -4436,17 +4429,6 @@ function setShowPic { if [ ! -f "$STLGHEADD/$AID.jpg" ]; then writelog "INFO" "${FUNCNAME[0]} - Using '$SHOWPIC' as fallback picture, because '$STLGHEADD/$AID.jpg' doesn't exist" - elif [ -f "$STLGHEADD/$AID.jpg" ] && [ ! -s "$STLGHEADD/$AID.jpg" ]; then - # Attempt to redownload header picture if we failed last time (e.g., if we were offline) - writelog "INFO" "${FUNCNAME[0]} - Game header picture exists at '$STLGHEADD/$AID.jpg' but has zero bytes. Attempting one redownload" - getGameData "$AID" - - if [ -s "$STLGHEADD/$AID.jpg" ]; then - writelog "INFO" "${FUNCNAME[0]} - Successfully redownloaded header picture for '$AID' to '$STLGHEADD/$AID.jpg', using that." - SHOWPIC="$STLGHEADD/$AID.jpg" # Actually use the new picture - else - writelog "INFO" "${FUNCNAME[0]} - Could not redownload header picture, defaulting '$SHOWPIC' to STL icon '$STLICON' (Maybe we're offline?)" - fi elif [ ! -s "$STLGHEADD/$AID.jpg" ]; then if [ -z "$SUSDA" ] || [ -z "$STUIDPATH" ]; then setSteamPaths @@ -4466,6 +4448,13 @@ function setShowPic { writelog "INFO" "${FUNCNAME[0]} - Leaving '$STLGHEADD/$AID.jpg' as is to avoid another download attempt" writelog "INFO" "${FUNCNAME[0]} - Feel free to replace it with a custom picture" fi + elif [[ ( ! -f "$STLGHEADD/$AID.jpg" || ! -s "$STLGHEADD/$AID.jpg" ) && -n "$GRIDBANNER" ]]; then + # If banner image still doesn't exist, use grid folder one (i.e. non-steam games) + # Find custom image in grid folder and store resized image at '$STLGHEADD/' + writelog "INFO" "${FUNCNAME[0]} - Using hero image found in Steam Grid folder - '$GRIDBANNER'" + CUSTPIC="$GRIDBANNER" + "$CONVERT" "$CUSTPIC" -resize "460x215!" "$STLGHEADD/${AID}.jpg" + SHOWPIC="$STLGHEADD/${AID}.jpg" fi fi else @@ -6832,7 +6821,6 @@ function extWine64Run { fi } -# NOTE: This needs an update to support launch commands set with `buildCustomCmdLaunch` - e.g. ONLY_CUSTOMCMD function extProtonRun { MODE="$1" PROGRAM="$2" @@ -21423,7 +21411,7 @@ function howto { echo " :" echo " --search-id= Steam AppID or SteamGridDB Game ID to search for (ex: AppID 22330 or Game ID 5258102)" echo " --filename-appid= Steam AppID to use when naming the file, only required when searching on Game ID so the artwork is applied to the correct Shortcut" - echo " --steam The Search ID passed is for a Steam AppID" + echo " --steam The Search ID passed is for a Steam AppID (default)" echo " --nonsteam The Search ID passed is for a SteamGridDB Game ID" echo " --apply Apply the downloaded game artwork to the Steam game (if not set, artwork will be downloaded to SteamTinkerLaunch Grid directory only)" echo " --skip-existing Skip setting artwork for this game if it already has custom artwork" From 50a951e39f53480a5b51c82d58f9f5b13a119792 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Tue, 17 Oct 2023 17:05:44 +0100 Subject: [PATCH 22/23] update langfiles --- lang/chinese.txt | 14 +++++++++++++- lang/dutch.txt | 14 +++++++++++++- lang/englishUK.txt | 14 +++++++++++++- lang/french.txt | 14 +++++++++++++- lang/german.txt | 14 +++++++++++++- lang/italian.txt | 14 +++++++++++++- lang/polish.txt | 14 +++++++++++++- lang/russian.txt | 14 +++++++++++++- steamtinkerlaunch | 2 +- 9 files changed, 105 insertions(+), 9 deletions(-) diff --git a/lang/chinese.txt b/lang/chinese.txt index 58cad118..1be91cd9 100644 --- a/lang/chinese.txt +++ b/lang/chinese.txt @@ -462,7 +462,7 @@ GUI_OPTSGRID="SteamGridDB 选项" GUI_SGDBSTYLES="样式" DESC_SGDBSTYLES="样式过滤选项" GUI_SGDBDIMS="尺寸" -DESC_SGDBDIMS="尺寸过滤选项" +DESC_SGDBDIMS="Dimension filter options, in order of priority" GUI_SGDBTYPES="类型" DESC_SGDBTYPES="类型过滤选项" GUI_SGDBNSFW="NSFW" @@ -1241,3 +1241,15 @@ GUI_NOSTSGDBAID="SteamGridDB Game ID (optional)" DESC_NOSTSGDBAID="the SteamGridDB Game ID to search on to find grids automatically (requires SteamGridDB API key set on Global Menu) -- This will respect the SteamGridDB options on the Global Menu" GUI_USESPEKD3D47="Use d3dcompiler_47 with SpecialK" DESC_USESPEKD3D47="copy d3dcompiler_47 to game files, normally required but sometimes OS/drivers/SpecialK/ReShade may crash with it -- Disabling will remove this DLL only if it was installed by SteamTinkerLaunch for SpecialK" +GUI_SGDBDLHERO="Download Hero Artwork" +DESC_SGDBDLHERO="enable downloading Hero (banner) artwork from SteamGridDB" +GUI_SGDBDLLOGO="Download Logo Artwork" +DESC_SGDBDLLOGO="enable downloading Logo artwork from SteamGridDB" +GUI_SGDBDLBOXART="Download Boxart" +DESC_SGDBDLBOXART="enable downloading Boxart (vertical grid) artwork from SteamGridDB" +GUI_SGDBDLTENFOOT="Download Tenfoot" +DESC_SGDBDLTENFOOT="enable downloading Tenfoot (Horizontal grid) artwork from SteamGridDB" +GUI_SGDBEPILEPSY="Epilepsy" +DESC_SGDBEPILEPSY="epilepsy options" +NOTY_SGDBDL="Downloading artwork from SteamGridDB" +NOTY_SGDBDLDONE="Finished downloading artwork from SteamGridDB" diff --git a/lang/dutch.txt b/lang/dutch.txt index 45ad06c6..7292213a 100644 --- a/lang/dutch.txt +++ b/lang/dutch.txt @@ -458,7 +458,7 @@ GUI_OPTSGRID="SteamGridDB options" GUI_SGDBSTYLES="Styles" DESC_SGDBSTYLES="Style filter options" GUI_SGDBDIMS="Dimensions" -DESC_SGDBDIMS="Dimension filter options" +DESC_SGDBDIMS="Dimension filter options, in order of priority" GUI_SGDBTYPES="Types" DESC_SGDBTYPES="Type filter options" GUI_SGDBNSFW="NSFW" @@ -1240,3 +1240,15 @@ GUI_NOSTSGDBAID="SteamGridDB Game ID (optional)" DESC_NOSTSGDBAID="the SteamGridDB Game ID to search on to find grids automatically (requires SteamGridDB API key set on Global Menu) -- This will respect the SteamGridDB options on the Global Menu" GUI_USESPEKD3D47="Use d3dcompiler_47 with SpecialK" DESC_USESPEKD3D47="copy d3dcompiler_47 to game files, normally required but sometimes OS/drivers/SpecialK/ReShade may crash with it -- Disabling will remove this DLL only if it was installed by SteamTinkerLaunch for SpecialK" +GUI_SGDBDLHERO="Download Hero Artwork" +DESC_SGDBDLHERO="enable downloading Hero (banner) artwork from SteamGridDB" +GUI_SGDBDLLOGO="Download Logo Artwork" +DESC_SGDBDLLOGO="enable downloading Logo artwork from SteamGridDB" +GUI_SGDBDLBOXART="Download Boxart" +DESC_SGDBDLBOXART="enable downloading Boxart (vertical grid) artwork from SteamGridDB" +GUI_SGDBDLTENFOOT="Download Tenfoot" +DESC_SGDBDLTENFOOT="enable downloading Tenfoot (Horizontal grid) artwork from SteamGridDB" +GUI_SGDBEPILEPSY="Epilepsy" +DESC_SGDBEPILEPSY="epilepsy options" +NOTY_SGDBDL="Downloading artwork from SteamGridDB" +NOTY_SGDBDLDONE="Finished downloading artwork from SteamGridDB" diff --git a/lang/englishUK.txt b/lang/englishUK.txt index f26c7c10..06a70bd5 100644 --- a/lang/englishUK.txt +++ b/lang/englishUK.txt @@ -458,7 +458,7 @@ GUI_OPTSGRID="SteamGridDB options" GUI_SGDBSTYLES="Styles" DESC_SGDBSTYLES="Style filter options" GUI_SGDBDIMS="Dimensions" -DESC_SGDBDIMS="Dimension filter options" +DESC_SGDBDIMS="Dimension filter options, in order of priority" GUI_SGDBTYPES="Types" DESC_SGDBTYPES="Type filter options" GUI_SGDBNSFW="NSFW" @@ -1240,3 +1240,15 @@ GUI_NOSTSGDBAID="SteamGridDB Game ID (optional)" DESC_NOSTSGDBAID="the SteamGridDB Game ID to search on to find grids automatically (requires SteamGridDB API key set on Global Menu) -- This will respect the SteamGridDB options on the Global Menu" GUI_USESPEKD3D47="Use d3dcompiler_47 with SpecialK" DESC_USESPEKD3D47="copy d3dcompiler_47 to game files, normally required but sometimes OS/drivers/SpecialK/ReShade may crash with it -- Disabling will remove this DLL only if it was installed by SteamTinkerLaunch for SpecialK" +GUI_SGDBDLHERO="Download Hero Artwork" +DESC_SGDBDLHERO="enable downloading Hero (banner) artwork from SteamGridDB" +GUI_SGDBDLLOGO="Download Logo Artwork" +DESC_SGDBDLLOGO="enable downloading Logo artwork from SteamGridDB" +GUI_SGDBDLBOXART="Download Boxart" +DESC_SGDBDLBOXART="enable downloading Boxart (vertical grid) artwork from SteamGridDB" +GUI_SGDBDLTENFOOT="Download Tenfoot" +DESC_SGDBDLTENFOOT="enable downloading Tenfoot (Horizontal grid) artwork from SteamGridDB" +GUI_SGDBEPILEPSY="Epilepsy" +DESC_SGDBEPILEPSY="epilepsy options" +NOTY_SGDBDL="Downloading artwork from SteamGridDB" +NOTY_SGDBDLDONE="Finished downloading artwork from SteamGridDB" diff --git a/lang/french.txt b/lang/french.txt index 05700015..10fb0ab6 100644 --- a/lang/french.txt +++ b/lang/french.txt @@ -457,7 +457,7 @@ GUI_OPTSGRID="Options de SteamGridDB" GUI_SGDBSTYLES="Styles" DESC_SGDBSTYLES="Options de filtre de style" GUI_SGDBDIMS="Dimensions" -DESC_SGDBDIMS="Dimension filter options" +DESC_SGDBDIMS="Dimension filter options, in order of priority" GUI_SGDBTYPES="Types" DESC_SGDBTYPES="Type filter options" GUI_SGDBNSFW="NSFW" @@ -1239,3 +1239,15 @@ GUI_NOSTSGDBAID="SteamGridDB Game ID (optional)" DESC_NOSTSGDBAID="the SteamGridDB Game ID to search on to find grids automatically (requires SteamGridDB API key set on Global Menu) -- This will respect the SteamGridDB options on the Global Menu" GUI_USESPEKD3D47="Use d3dcompiler_47 with SpecialK" DESC_USESPEKD3D47="copy d3dcompiler_47 to game files, normally required but sometimes OS/drivers/SpecialK/ReShade may crash with it -- Disabling will remove this DLL only if it was installed by SteamTinkerLaunch for SpecialK" +GUI_SGDBDLHERO="Download Hero Artwork" +DESC_SGDBDLHERO="enable downloading Hero (banner) artwork from SteamGridDB" +GUI_SGDBDLLOGO="Download Logo Artwork" +DESC_SGDBDLLOGO="enable downloading Logo artwork from SteamGridDB" +GUI_SGDBDLBOXART="Download Boxart" +DESC_SGDBDLBOXART="enable downloading Boxart (vertical grid) artwork from SteamGridDB" +GUI_SGDBDLTENFOOT="Download Tenfoot" +DESC_SGDBDLTENFOOT="enable downloading Tenfoot (Horizontal grid) artwork from SteamGridDB" +GUI_SGDBEPILEPSY="Epilepsy" +DESC_SGDBEPILEPSY="epilepsy options" +NOTY_SGDBDL="Downloading artwork from SteamGridDB" +NOTY_SGDBDLDONE="Finished downloading artwork from SteamGridDB" diff --git a/lang/german.txt b/lang/german.txt index df0f45d4..146032da 100644 --- a/lang/german.txt +++ b/lang/german.txt @@ -458,7 +458,7 @@ GUI_OPTSGRID="SteamGridDB Optionen" GUI_SGDBSTYLES="Styles" DESC_SGDBSTYLES="Style Filter Optionen" GUI_SGDBDIMS="Dimensions" -DESC_SGDBDIMS="Dimension Filter Optionen" +DESC_SGDBDIMS="Dimension filter options, in order of priority" GUI_SGDBTYPES="Types" DESC_SGDBTYPES="Type Filter Optionen" GUI_SGDBNSFW="NSFW" @@ -1242,3 +1242,15 @@ GUI_NOSTSGDBAID="SteamGridDB Game ID (optional)" DESC_NOSTSGDBAID="the SteamGridDB Game ID to search on to find grids automatically (requires SteamGridDB API key set on Global Menu) -- This will respect the SteamGridDB options on the Global Menu" GUI_USESPEKD3D47="Use d3dcompiler_47 with SpecialK" DESC_USESPEKD3D47="copy d3dcompiler_47 to game files, normally required but sometimes OS/drivers/SpecialK/ReShade may crash with it -- Disabling will remove this DLL only if it was installed by SteamTinkerLaunch for SpecialK" +GUI_SGDBDLHERO="Download Hero Artwork" +DESC_SGDBDLHERO="enable downloading Hero (banner) artwork from SteamGridDB" +GUI_SGDBDLLOGO="Download Logo Artwork" +DESC_SGDBDLLOGO="enable downloading Logo artwork from SteamGridDB" +GUI_SGDBDLBOXART="Download Boxart" +DESC_SGDBDLBOXART="enable downloading Boxart (vertical grid) artwork from SteamGridDB" +GUI_SGDBDLTENFOOT="Download Tenfoot" +DESC_SGDBDLTENFOOT="enable downloading Tenfoot (Horizontal grid) artwork from SteamGridDB" +GUI_SGDBEPILEPSY="Epilepsy" +DESC_SGDBEPILEPSY="epilepsy options" +NOTY_SGDBDL="Downloading artwork from SteamGridDB" +NOTY_SGDBDLDONE="Finished downloading artwork from SteamGridDB" diff --git a/lang/italian.txt b/lang/italian.txt index eabd6925..cd7fa10d 100644 --- a/lang/italian.txt +++ b/lang/italian.txt @@ -458,7 +458,7 @@ GUI_OPTSGRID="Opzioni SteamGridDB" GUI_SGDBSTYLES="Stili" DESC_SGDBSTYLES="Stile delle opzioni di filtro" GUI_SGDBDIMS="Dimensioni" -DESC_SGDBDIMS="Dimensioni delle opzioni di filtro" +DESC_SGDBDIMS="Dimension filter options, in order of priority" GUI_SGDBTYPES="Tipi" DESC_SGDBTYPES="Opzioni tipo di filtro" GUI_SGDBNSFW="NSFW" @@ -1240,3 +1240,15 @@ GUI_NOSTSGDBAID="SteamGridDB Game ID (optional)" DESC_NOSTSGDBAID="the SteamGridDB Game ID to search on to find grids automatically (requires SteamGridDB API key set on Global Menu) -- This will respect the SteamGridDB options on the Global Menu" GUI_USESPEKD3D47="Use d3dcompiler_47 with SpecialK" DESC_USESPEKD3D47="copy d3dcompiler_47 to game files, normally required but sometimes OS/drivers/SpecialK/ReShade may crash with it -- Disabling will remove this DLL only if it was installed by SteamTinkerLaunch for SpecialK" +GUI_SGDBDLHERO="Download Hero Artwork" +DESC_SGDBDLHERO="enable downloading Hero (banner) artwork from SteamGridDB" +GUI_SGDBDLLOGO="Download Logo Artwork" +DESC_SGDBDLLOGO="enable downloading Logo artwork from SteamGridDB" +GUI_SGDBDLBOXART="Download Boxart" +DESC_SGDBDLBOXART="enable downloading Boxart (vertical grid) artwork from SteamGridDB" +GUI_SGDBDLTENFOOT="Download Tenfoot" +DESC_SGDBDLTENFOOT="enable downloading Tenfoot (Horizontal grid) artwork from SteamGridDB" +GUI_SGDBEPILEPSY="Epilepsy" +DESC_SGDBEPILEPSY="epilepsy options" +NOTY_SGDBDL="Downloading artwork from SteamGridDB" +NOTY_SGDBDLDONE="Finished downloading artwork from SteamGridDB" diff --git a/lang/polish.txt b/lang/polish.txt index 640d86ba..58a1db3e 100644 --- a/lang/polish.txt +++ b/lang/polish.txt @@ -458,7 +458,7 @@ GUI_OPTSGRID="Opcje SteamGridDB" GUI_SGDBSTYLES="Style" DESC_SGDBSTYLES="Opcje filtrowania styli" GUI_SGDBDIMS="Rozmiar" -DESC_SGDBDIMS="Opcje filtru rozmiaru" +DESC_SGDBDIMS="Dimension filter options, in order of priority" GUI_SGDBTYPES="Typy" DESC_SGDBTYPES="Opcje filtru typu" GUI_SGDBNSFW="NSFW" @@ -1240,3 +1240,15 @@ GUI_NOSTSGDBAID="SteamGridDB Game ID (optional)" DESC_NOSTSGDBAID="the SteamGridDB Game ID to search on to find grids automatically (requires SteamGridDB API key set on Global Menu) -- This will respect the SteamGridDB options on the Global Menu" GUI_USESPEKD3D47="Use d3dcompiler_47 with SpecialK" DESC_USESPEKD3D47="copy d3dcompiler_47 to game files, normally required but sometimes OS/drivers/SpecialK/ReShade may crash with it -- Disabling will remove this DLL only if it was installed by SteamTinkerLaunch for SpecialK" +GUI_SGDBDLHERO="Download Hero Artwork" +DESC_SGDBDLHERO="enable downloading Hero (banner) artwork from SteamGridDB" +GUI_SGDBDLLOGO="Download Logo Artwork" +DESC_SGDBDLLOGO="enable downloading Logo artwork from SteamGridDB" +GUI_SGDBDLBOXART="Download Boxart" +DESC_SGDBDLBOXART="enable downloading Boxart (vertical grid) artwork from SteamGridDB" +GUI_SGDBDLTENFOOT="Download Tenfoot" +DESC_SGDBDLTENFOOT="enable downloading Tenfoot (Horizontal grid) artwork from SteamGridDB" +GUI_SGDBEPILEPSY="Epilepsy" +DESC_SGDBEPILEPSY="epilepsy options" +NOTY_SGDBDL="Downloading artwork from SteamGridDB" +NOTY_SGDBDLDONE="Finished downloading artwork from SteamGridDB" diff --git a/lang/russian.txt b/lang/russian.txt index ec0786a2..30a4dcd5 100644 --- a/lang/russian.txt +++ b/lang/russian.txt @@ -458,7 +458,7 @@ GUI_OPTSGRID="SteamGridDB Options" GUI_SGDBSTYLES="Styles" DESC_SGDBSTYLES="Style Filter Options" GUI_SGDBDIMS="Dimensions" -DESC_SGDBDIMS="Dimension Filter Options" +DESC_SGDBDIMS="Dimension filter options, in order of priority" GUI_SGDBTYPES="Types" DESC_SGDBTYPES="Type Filter Options" GUI_SGDBNSFW="NSFW" @@ -1240,3 +1240,15 @@ GUI_NOSTSGDBAID="SteamGridDB Game ID (optional)" DESC_NOSTSGDBAID="the SteamGridDB Game ID to search on to find grids automatically (requires SteamGridDB API key set on Global Menu) -- This will respect the SteamGridDB options on the Global Menu" GUI_USESPEKD3D47="Use d3dcompiler_47 with SpecialK" DESC_USESPEKD3D47="copy d3dcompiler_47 to game files, normally required but sometimes OS/drivers/SpecialK/ReShade may crash with it -- Disabling will remove this DLL only if it was installed by SteamTinkerLaunch for SpecialK" +GUI_SGDBDLHERO="Download Hero Artwork" +DESC_SGDBDLHERO="enable downloading Hero (banner) artwork from SteamGridDB" +GUI_SGDBDLLOGO="Download Logo Artwork" +DESC_SGDBDLLOGO="enable downloading Logo artwork from SteamGridDB" +GUI_SGDBDLBOXART="Download Boxart" +DESC_SGDBDLBOXART="enable downloading Boxart (vertical grid) artwork from SteamGridDB" +GUI_SGDBDLTENFOOT="Download Tenfoot" +DESC_SGDBDLTENFOOT="enable downloading Tenfoot (Horizontal grid) artwork from SteamGridDB" +GUI_SGDBEPILEPSY="Epilepsy" +DESC_SGDBEPILEPSY="epilepsy options" +NOTY_SGDBDL="Downloading artwork from SteamGridDB" +NOTY_SGDBDLDONE="Finished downloading artwork from SteamGridDB" diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 27aa9be7..f3c36b7f 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231019-3 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231019-4 (steamgriddb-overhaul)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" From cff8c388698cf1c756748dffd9946da86b37fc0e Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Tue, 17 Oct 2023 19:51:59 +0100 Subject: [PATCH 23/23] version bump + --no-apply flag --- steamtinkerlaunch | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index f3c36b7f..a9f654fd 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231019-4 (steamgriddb-overhaul)" +PROGVERS="v14.0.20231018-1" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -1530,9 +1530,9 @@ function getSteamGridDBArtwork { # # This function can be used on the commandline or just when we want to search for a game by Game ID function commandlineGetSteamGridDBArtwork { - SGDBENDPOINTTYPE="steam" + SGDBENDPOINTTYPE="steam" # assume Steam game by default (i.e. search Steam AppID endpoint) GSGDBA_HASFILE="$SGDBHASFILE" # Optional override for how to handle if file already exists (downloadArtFromSteamGridDB defaults to '$SGDBHASFILE') - GSGDBA_APPLYARTWORK="0" + GSGDBA_APPLYARTWORK="$SGDBDLTOSTEAM" for i in "${@}"; do case $i in --search-id=*) # ID to hit the SteamGridDB API endpoint with (for Steam games this is the AppID which we will also use as filename) @@ -1564,6 +1564,10 @@ function commandlineGetSteamGridDBArtwork { ## OPTIONAL: Flag to force downloading to SteamGridDB folder (used for addNonSteamGame internally) --apply) GSGDBA_APPLYARTWORK="1" + shift ;; + --no-apply) + GSGDBA_APPLYARTWORK="0" + shift ;; esac done @@ -1571,9 +1575,6 @@ function commandlineGetSteamGridDBArtwork { SGDBSEARCHENDPOINT_LOGO="${BASESTEAMGRIDDBAPI}/logos/${SGDBENDPOINTTYPE}" SGDBSEARCHENDPOINT_BOXART="${BASESTEAMGRIDDBAPI}/grids/${SGDBENDPOINTTYPE}" # Grid endpoint is used for Boxart and Tenfoot, which SteamGridDB counts as vertical/horizontal grids respectively - # TODO - # - Consider making --steam the default - # Download Hero, Logo, Boxart, Tenfoot from SteamGridDB from given endpoint using given AppID # On SteamGridDB, tenfoot is grouped with grids, but as a horizontal Steam grid, so we fetch it by passing specific dimensions matching this # Users are free to override this, but the default is what SteamGridDB expects for the tenfoot sizes @@ -21414,6 +21415,7 @@ function howto { echo " --steam The Search ID passed is for a Steam AppID (default)" echo " --nonsteam The Search ID passed is for a SteamGridDB Game ID" echo " --apply Apply the downloaded game artwork to the Steam game (if not set, artwork will be downloaded to SteamTinkerLaunch Grid directory only)" + echo " --no-apply Don't apply the downloaded game artwork (artwork will be downloaded to SteamTinkerLaunch Grid directory only)" echo " --skip-existing Skip setting artwork for this game if it already has custom artwork" echo " --replace-existing Replace existing artwork files for this game -- they cannot be recovered later" echo " --backup-existing Backup existing artwork files for this game before replacing them, so they can be restored"