Skip to content

Commit

Permalink
SteamGridDB: Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sonic2kk committed Jan 11, 2024
1 parent 1ea5a89 commit 4e8d0dd
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v14.0.20230112-3 (sgdb-artwork-gui)"
PROGVERS="v14.0.20230112-4 (sgdb-artwork-gui)"
PROGCMD="${0##*/}"
PROGINTERNALPROTNAME="Proton-stl"
SHOSTL="stl"
Expand Down Expand Up @@ -1550,19 +1550,10 @@ function getSteamGridDBArtworkGUI {
pollWinRes "$TITLE"
setShowPic

## TODO adjust dialog size, it's too tall and probably too wide
## TODO display game banner like we do in Set Game Art?
#
# Remove below after implementation:
#
# Menu will work by having boxes for a Steam AppID, SteamGridDB Game ID, or Game Name
# - If Steam AppID box is populated, ignore Game ID box and search on Steam AppID (--search-id="$FSGDBSN" and store "--steam" as variable to pass to cmd)
# - Otherwise use Game ID box (store "--nonsteam" as variable to pass to cmd)
# Will also have box for Game Name which we will always pass (if no match found for name, we should fall back to one of the AppIDs given)
# If all boxes are empty, nothing will happen
# Show notifier to display some feedback, and use logging to note what values we got and what is being prioritised
# Since we'll have the AppID handy, we can specify the filename_appid
#
# AppID passed from commandline is used as --filename-appid
# User can provide Steam AppID, SteamGridDB Game ID, or Game Name (used to attempt to fetch SteamGridDB Game ID)
# - Steam AppID is prioritised if provided
# - commandlineGetSteamGridDBArtwork is set to fall back to SteamGridDB Game ID if Game Name doesn't return anything, so passing both is fine
# SGDBHASFILE will use the global option by default and populate the dropdown with the relevant option, just like the command does
# It will use the Global Menu default, but also allows the user to specify a different action this time
#
Expand Down Expand Up @@ -1612,16 +1603,6 @@ function getSteamGridDBArtworkGUI {
FSGDBAWAPPLYARTWORKFLAG="--no-apply"
fi

# Extra logging, mainly for debugging purposes
writelog "INFO" "${FUNCNAME[0]} - FSGDBAWAPPID: ${FSGDBAWAPPID}"
writelog "INFO" "${FUNCNAME[0]} - FSGDBAWGAMEID: ${FSGDBAWGAMEID}"
writelog "INFO" "${FUNCNAME[0]} - FSGDBAWSEARCHNAME: ${FSGDBAWSEARCHNAME}"
writelog "INFO" "${FUNCNAME[0]} - FSGDBAWHASFILE: ${FSGDBAWHASFILE}"
writelog "INFO" "${FUNCNAME[0]} - FSGDBAWAPPLYARTWORK: ${FSGDBAWAPPLYARTWORK}"
writelog "INFO" "${FUNCNAME[0]} - ############################################"
writelog "INFO" "${FUNCNAME[0]} - FSGDBAWGAMETYPEFLAG: ${FSGDBAWGAMETYPEFLAG}"
writelog "INFO" "${FUNCNAME[0]} - FSGDBAWAPPLYARTWORKFLAG: ${FSGDBAWAPPLYARTWORKFLAG}"

# Execute actual fetching of artwork, could probably put notifier here
writelog "INFO" "${FUNCNAME[0]} - Executing 'commandlineGetSteamGridDBArtwork --search-id=\"${FSGDBAWGAMEID}\" --search-name=\"${FSGDBAWSEARCHNAME}\" --filename-appid=\"${FSGDBAWFILENAMEAPPID}\" \"${FSGDBAWHASFILE}\" \"${FSGDBAWGAMETYPEFLAG}\"'"
commandlineGetSteamGridDBArtwork --search-id="${FSGDBAWSEARCHID}" --search-name="${FSGDBAWSEARCHNAME}" --filename-appid="${FSGDBAWFILENAMEAPPID}" "${FSGDBAWHASFILE}" "${FSGDBAWAPPLYARTWORKFLAG}" "${FSGDBAWGAMETYPEFLAG}"
Expand Down

0 comments on commit 4e8d0dd

Please sign in to comment.