Fix logo download and double download

parent 0483902b
...@@ -150,7 +150,7 @@ function downloadArtFromSteamGridDB { ...@@ -150,7 +150,7 @@ function downloadArtFromSteamGridDB {
[[ -n "$SEARCHHUMOR" ]] && SGDB_ENDPOINT_STR+="&humor=${SEARCHHUMOR}" [[ -n "$SEARCHHUMOR" ]] && SGDB_ENDPOINT_STR+="&humor=${SEARCHHUMOR}"
[[ -n "$SEARCHEPILEPSY" ]] && SGDB_ENDPOINT_STR+="&epilepsy=${SEARCHEPILEPSY}" [[ -n "$SEARCHEPILEPSY" ]] && SGDB_ENDPOINT_STR+="&epilepsy=${SEARCHEPILEPSY}"
RESPONSE=$(curl -H "Authorization: Bearer $SGDBAPIKEY" -s "$SGDB_ENDPOINT_STR" 2> >(grep -v "SSL_INIT"))
if ! jq -e '.success' <<< "$RESPONSE" > /dev/null; then if ! jq -e '.success' <<< "$RESPONSE" > /dev/null; then
echo "The server response wasn't 'success' for this batch of requested games." echo "The server response wasn't 'success' for this batch of requested games."
return return
...@@ -194,7 +194,7 @@ function downloadArtFromSteamGridDB { ...@@ -194,7 +194,7 @@ function downloadArtFromSteamGridDB {
fi fi
if [[ "$STARTDL" -eq 1 ]] ; then if [[ "$STARTDL" -eq 1 ]] ; then
curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' -H 'Pragma: no-cache' -L "$DLSRC" -o "$DLDST" curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' -H 'Pragma: no-cache' -L "$DLSRC" -o "$DLDST" 2>&1
fi fi
else else
echo "No grid found to download for '$SEARCHID' - maybe loosen filters?" echo "No grid found to download for '$SEARCHID' - maybe loosen filters?"
...@@ -280,10 +280,11 @@ function commandlineGetSteamGridDBArtwork { ...@@ -280,10 +280,11 @@ function commandlineGetSteamGridDBArtwork {
SGDBSEARCHENDPOINT_HERO="${BASESTEAMGRIDDBAPI}/heroes/${SGDBENDPOINTTYPE}" SGDBSEARCHENDPOINT_HERO="${BASESTEAMGRIDDBAPI}/heroes/${SGDBENDPOINTTYPE}"
SGDBSEARCHENDPOINT_LOGO="${BASESTEAMGRIDDBAPI}/logos/${SGDBENDPOINTTYPE}" 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 SGDBSEARCHENDPOINT_BOXART="${BASESTEAMGRIDDBAPI}/grids/${SGDBENDPOINTTYPE}" # Grid endpoint is used for Boxart and Tenfoot, which SteamGridDB counts as vertical/horizontal grids respectively
SGDB_ENDPOINT_STR="${SGDBSEARCHENDPOINT_HERO}/$(echo "$GSGDBA_APPID" | awk '{print $1}' | paste -s -d, -)?" SGDB_ENDPOINT_STR_TEST="${SGDBSEARCHENDPOINT_HERO}/$(echo "$GSGDBA_APPID" | awk '{print $1}' | paste -s -d, -)?"
set -o pipefail set -o pipefail
RESPONSE=$(curl -H "Authorization: Bearer $SGDBAPIKEY" -s "$SGDB_ENDPOINT_STR" 2> >(grep -v "SSL_INIT")) TEST_RESPONSE=$(curl -H "Authorization: Bearer $SGDBAPIKEY" -s "$SGDB_ENDPOINT_STR_TEST" 2> >(grep -v "SSL_INIT"))
if [[ "${PIPESTATUS[0]}" != 0 ]] && [[ "$DOWNLOAD_STEAM_GRID" != 0 ]]; then if [[ "${PIPESTATUS[0]}" != 0 ]] && [[ "$DOWNLOAD_STEAM_GRID" != 0 ]]; then
pw_notify_send -i info \ pw_notify_send -i info \
"${translations[SteamGridDB is not responding, forcing cover download to be disabled]}" "${translations[SteamGridDB is not responding, forcing cover download to be disabled]}"
...@@ -291,18 +292,20 @@ function commandlineGetSteamGridDBArtwork { ...@@ -291,18 +292,20 @@ function commandlineGetSteamGridDBArtwork {
export DOWNLOAD_STEAM_GRID="0" export DOWNLOAD_STEAM_GRID="0"
return return
fi fi
if [[ ! -z "$GSGDBA_FOUNDGAMEID" ]] ; then
pw_start_progress_bar_block "${translations[Please wait. downloading covers for]} $NOSTAPPNAME" # Download Hero, Logo, Boxart, Tenfoot from SteamGridDB from given endpoint using given AppID
# Download Hero, Logo, Boxart, Tenfoot from SteamGridDB from given endpoint using given AppID # On SteamGridDB tenfoot called horizontal Steam grid, so fetch it by passing specific dimensions matching this -- Users can override this, but default is what SteamGridDB expects for the tenfoot sizes
# On SteamGridDB tenfoot called horizontal Steam grid, so fetch it by passing specific dimensions matching this -- Users can override this, but default is what SteamGridDB expects for the tenfoot sizes if [[ ! -z "$GSGDBA_FOUNDGAMEID" ]] ; then
pw_start_progress_bar_block "${translations[Please wait. downloading covers for]} $NOSTAPPNAME"
downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "$SGDBHEROSTYLES" "$SGDBHERODIMS" "$SGDBHEROTYPES" "$SGDBHERONSFW" "$SGDBHEROHUMOR" "$SGDBHEROEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_HERO" "${GSGDBA_FILENAME}_hero" "$SGDBHEROSTYLES" "$SGDBHERODIMS" "$SGDBHEROTYPES" "$SGDBHERONSFW" "$SGDBHEROHUMOR" "$SGDBHEROEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK"
# Logo doesn't have dimensions, so it's left intentionally blank # Logo doesn't have dimensions, so it's left intentionally blank
downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_LOGO" "${GSGDBA_FILENAME}_logo" "$SGDBLOGOSTYLES" "" "$SGDBLOGOTYPES" "$SGDBLOGONSFW" "$SGDBLOGOHUMOR" "$SGDBLOGOEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_LOGO" "${GSGDBA_FILENAME}_logo" "$SGDBLOGOSTYLES" "" "$SGDBLOGOTYPES" "$SGDBLOGONSFW" "$SGDBLOGOHUMOR" "$SGDBLOGOEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK"
downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}p" "$SGDBBOXARTSTYLES" "$SGDBBOXARTDIMS" "$SGDBBOXARTTYPES" "$SGDBBOXARTNSFW" "$SGDBBOXARTHUMOR" "$SGDBBOXARTEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}p" "$SGDBBOXARTSTYLES" "$SGDBBOXARTDIMS" "$SGDBBOXARTTYPES" "$SGDBBOXARTNSFW" "$SGDBBOXARTHUMOR" "$SGDBBOXARTEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK"
downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}" "$SGDBTENFOOTSTYLES" "$SGDBTENFOOTDIMS" "$SGDBTENFOOTTYPES" "$SGDBTENFOOTNSFW" "$SGDBTENFOOTHUMOR" "$SGDBTENFOOTEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK" downloadArtFromSteamGridDB "$GSGDBA_APPID" "$SGDBSEARCHENDPOINT_BOXART" "${GSGDBA_FILENAME}" "$SGDBTENFOOTSTYLES" "$SGDBTENFOOTDIMS" "$SGDBTENFOOTTYPES" "$SGDBTENFOOTNSFW" "$SGDBTENFOOTHUMOR" "$SGDBTENFOOTEPILEPSY" "$GSGDBA_HASFILE" "$GSGDBA_APPLYARTWORK"
pw_stop_progress_bar pw_stop_progress_bar
fi fi
} }
## Fetch artwork from SteamGridDB ## Fetch artwork from SteamGridDB
......
...@@ -5663,14 +5663,17 @@ portwine_create_shortcut () { ...@@ -5663,14 +5663,17 @@ portwine_create_shortcut () {
fi fi
chmod u+x "${STEAM_SCRIPTS}/${name_desktop}.sh" chmod u+x "${STEAM_SCRIPTS}/${name_desktop}.sh"
export SCVDF="shortcuts.vdf" export SCVDF="shortcuts.vdf"
for STUIDPATH in "${HOME}"/.local/share/Steam/userdata/*/ ; do for STUIDPATH in "${HOME}"/.local/share/Steam/userdata/*/; do
create_new_dir "${STUIDPATH}/config/" if [[ -d "$STUIDPATH" ]]; then
create_new_dir "${STUIDPATH}/config/grid" create_new_dir "${STUIDPATH}config/"
export SCPATH="${STUIDPATH}/config/$SCVDF" create_new_dir "${STUIDPATH}config/grid"
export SGGRIDDIR="${STUIDPATH}/config/grid" export SCPATH="${STUIDPATH}config/$SCVDF"
# shellcheck source=/dev/null export SGGRIDDIR="${STUIDPATH}config/grid"
source "${PORT_SCRIPTS_PATH}/add_in_steam.sh" # shellcheck source=/dev/null
source "${PORT_SCRIPTS_PATH}/add_in_steam.sh"
fi
done done
if [[ "${PW_SKIP_RESTART_STEAM}" != 1 ]] && pgrep -i steam &>/dev/null ; then if [[ "${PW_SKIP_RESTART_STEAM}" != 1 ]] && pgrep -i steam &>/dev/null ; then
if yad_question "${translations[For adding shortcut to STEAM, needed restart.\\n\\nRestart STEAM now?]}" ; then if yad_question "${translations[For adding shortcut to STEAM, needed restart.\\n\\nRestart STEAM now?]}" ; then
pw_start_progress_bar_block "${translations[Restarting STEAM... Please wait.]}" pw_start_progress_bar_block "${translations[Restarting STEAM... Please wait.]}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment