-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SteamGridDB: Overhaul SteamGridDB Integration #934
Conversation
- 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
* 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
Added commandline usage. The SteamGridDB wiki page will need to be updated with detailed usage instructions. It should have examples of searching both for Steam games and Non-Steam games, instructions on how to get the AppID for Non-Steam games, instructions for how to apply the artwork manually from Steam (in case the user just wants to download it but wants to set it themselves in Steam/elsewhere), and more constellations for usage. Usage Examples(Note that there are more options than this, these are just high level examples for common usage) Get artwork for game in Steam library using Steam AppID # Download artwork for "The Elder Scrolls IV: Oblivion Game of the Year Edition" using its Steam AppID
# Note that the filename AppID is not specified. We use Search ID to name the file automatically as it is the Steam AppID
steamtinkerlaunch sgdb --search-id="22330" --steam --apply --skip-existing Get artwork for game in Steam library using SteamGridDB Game ID: # Download artwork for "The Elder Scrolls IV: Oblivion Game of the Year Edition" using its SteamGridDB Game ID
# Searches using the SteamGridDB Game ID but since the game is owned on Steam, name it after the actual Steam AppID
steamtinkerlaunch sgdb --search-id="5258102" --filename-appid="22330" --nonsteam --apply --skip-existing Get artwork for Non-Steam Game that is available on Steam using Steam AppID # Download artwork for "The Elder Scrolls IV: Oblivion Game of the Year Edition" using its Steam AppID despite it being added as a shortcut
# Assumes this is a Non-Steam Game (shortcut) but we're searching on the Steam AppID, yet naming the file after the Non-Steam AppID in the library
steamtinkerlaunch sgdb --search-id="22330" --filename-appid="12123123" --steam --apply --skip-existing Get artwork for Non-Steam Game using SteamGridDB Game ID # Download artwork for "The Elder Scrolls IV: Oblivion Game of the Year Edition", added as a Steam shortcut, using the SteamGridDB Game ID
# We search using SteamGridDB's Game ID and then name the downloaded file after the Steam shortcut ID
steamtinkerlaunch sgdb --search-id="5258102" --filename-appid="12123123" --nonsteam --apply --skip-existing We will also need to update other wiki pages, such as the Add Non-Steam Game wiki page, to note that as much artwork as is found will be downloaded, and that it will use the settings on the Global Menu to do so. Of course before we do that this PR will need to be ready for merging, and we're not there yet, as we don't have the GUI options. |
I may revisit the commandline usage either before merging this, or sometime after, as I have a feeling some improvements could be made... I'll let it simmer for a bit and see how it fares in my own usage, and how everything fits together once I actually get the GUI options set up so that dimensions and things can all work as expected. Once I can do a "full test" maybe I'll be more satisfied. I'm happy with how everything is architected, I like how I was able to break things out here and re-use |
The next steps for this PR is to overhaul the SteamGridDB Global Menu options, so that we can specify settings for the other artwork (dimensions is the primary one, but also categories, etc). We should also consider how to handle tenfoot artwork. I'm apprehensive about setting the hero artwork. Perhaps we could simply add a setting for the tenfoot with different dimensions? I'll have to see how they're categorised on SteamGridDB and how applicable this is, but we could simply categories the tenfoot separately yet internally have it reflect hero/boxart, but we give the endpoint the dimensions of the tenfoot. After this, we'll need to update all usages of A nice to have feature would be fetching and setting icons when adding Non-Steam Games. Currently we can't easily update these, as we don't have a good way of parsing and updating the Finally, after this, we'll need to do extensive testing. To protect my library on my PC, I may just test on my laptop (sine I'll need to dig it out for testing other PRs) and test the |
SteamGridDB does have a preset horizontal grid option that we could try to search on for tenfoot. I don't think we can explicitly pass this to the endpoint, though, so for tenfoot we'd have to just hit the grid endpoint with dimensions specified. So boxart and tenfoot would use the same endpoint, but with different dimensions. The dimensions on the UI should reflect the recommended Valve one, as well as the preset ones for the Steam GUI. We can't implement this on the commandline until we add the GUI options I think, unless we were to hardcode it. In testing, these grids appear to look fine, if not a little small at times. Big Picture Mode also looks fine, though sometimes the low resolution artwork is very noticeable at high resolutions. There's not much we can do about artwork looking strange except to prioritise higher resolution artwork. And if a user knows what they're doing, they can specify custom dimensions. I think using the grid endpoint again with different dimensions parameters is the way to go here. For grids we should give resolution options that SteamGridDB lists for Steam first, then GOG Galaxy 2.0. Square grids don't really apply and would look really off I think. When artwork is not found, this should already be logged, but it would be helpful to echo this out as well so users on the commandline know this as well. |
Especially given this new approach, we will need to consider migrating the cfg options, though we will probably ignore dimensions, since the existing dimensions options don't make sense to migrate. In other news, I temporarily hardcoded a call to SteamGridDB to fetch artwork with a size of Some less popular and some older games may not have grids with this size, but that isn't really an STL problem. That's up to users to manage. |
Seeing an error now, |
The new SteamGridDB GUI options are now in place! Logo does not have dimensions, but aside from this, we can now expose all options that would get passed to the SteamGridDB endpoint! This is untested for now, aside from spot-checking a couple of UI elements to make sure they save. We will need to check the following:
|
The way we're saving some of the default options for types (animated/static) is wrong and needs fixed. |
This is working from the commandline now, and it seems the options on the UI are working. Further testing is needed, but it seems like this should work now! Tenfoot is working great, I found out one of the styles we can remove from our search is |
Big remaining things left for this PR:
|
We can now get icons for Non-Steam Games if they exist on SteamGridDB! Very happy with how that turned out. |
When the remaining instances of |
Got around to replacing the remaining Most of what remains now is further testing. Upon further thought, I think having an option on the Game Menu to specify the SteamGridDB Game ID is useful, because if a user is downloading grids they may want to, for example, download artwork for "Sonic Colors" instead of "Sonic Colors: Ultimate", because the former has substantially more artwork (and better artwork imo) than the latter. That could also go in a separate PR though, as this one is getting pretty big. For Non-Steam Games, we could maybe store this? Though I am not sure if this would be feasible, it would be nice to store this as a preset value. We'd have to create a config file for the game at add-time, though... |
Marked the PR as ready now, because it is in a state where it could be tested (though should still be considered heavily in-flux). Another change I think I will make is to the commandline usage, to add some more sensible defaults perhaps. I will also continue to use and test this feature myself because it's fun 😄 Once I get more testing in and ensure that this integration doesn't break or do things it shouldn't (such as incorrectly download artwork when it's not supposed to), this should be ready to merge. Hopefully it will be merged this month 🥳 |
There is a SteamGridDB endpoint we can hit to try and search by Game Name, but I would need to investigate how this works. Endpoint is: https://www.steamgriddb.com/api/v2/search/autocomplete/ This is the same endpoint probably that the website hits to return game info, so we'd need to be careful that we manage the response properly. This would yet again be brand new functionality, so it would be implemented separately. Still, it would be really cool to have this especially for Non-Steam Games. It means we wouldn't have to rely on the SteamGridDB Game ID alone. It would also likewise be nice if we could optionally pass the Steam AppID when adding a Non-Steam Game, instead of just the SteamGridDB Game ID. The functionality in this PR would be a prerequisite to any work related to both of these, but it is something we can consider for future work. We could make searching SteamGridDB for the Game ID a commandline function as well, as it could be generally useful. |
Made a few more changes, still testing:
Not sure if I'll make any other changes to usage. I considered making I also investigated the I have also cleaned up a lot of the remaining TODOs, the rest (max file size option etc) can go in different PRs in the future as enhancements, as they're very much just nice to have and not crucial (the animated/static filter should handle most of that). I have done a good amount of testing with this already, replacing artwork, adding Non-Steam Games, and testing games never launched with SteamTinkerLaunch before. It seems to be working as expected, and won't default in any way to using SteamGridDB without the user explicitly using it. So remaining is just more testing, and then the wiki overhaul. But this should be ready very soon! |
I think this is working well enough that it's ready to merge once the wiki update is ready. There are still areas for improvement, such as finalizing commandline usage syntax/wording, and searching SteamGridDB for the Game ID using the Game Name, but overall it's in a good enough state for a merge. |
Wrote up a big wiki page overhaul, once this PR is merged the wiki can be updated. |
Added last minute change for |
Langfiles updated, shellcheck is good, version bumped, code looks good as well and this seems to work great in my testing. This is ready to merge! |
Will implement #933 or most of it, once completed. This is NOT ready for testing yet.
Massively WIP, but checklist for now:
getGrids
with the new functionsAdd option to fetch grids for all Non-Steam Games only (could be handy, especially when combined with the replace/skip options etc)(will go in a separate PR down the road)[ ] Add optional field on Game Menu for downloading SteamGridDB artworkSuperseded by commandline optionRight now, this works for Non-Steam Games, so that's a win! However it doesn't respect any of the SteamGridDB settings, because we need to overhaul these settings to accept dimensions etc for each type of grid.
We will also need to massively overhaul the wiki to document the changes here.