Skip to content
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: Add timeout and retries to SteamGridDB Artwork Fetching #958

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented Oct 23, 2023

Another bit for #933.

This adds a timeout for SteamGridDB, and a specific amount of retries. The default timeout is 15 seconds, and the maximum number of retries is set to 5.

The reason for this is wget will retry for 600 seconds by default. It will also infinitely retry. In testing I found there are intermittent failures when fetching artwork from SteamGridDB, where it will just hang (possibly related to my internet connection?).

A good use-case for this is when adding Non-Steam Games, even though you can Ctrl+C, this will end up corrupting the shortcuts.vdf and you will lose all your shortcuts. To prevent that case, and to hopefully retry and successfully download artwork, this change will allow for a timeout and retry. If wget fails after those 5 attempts it will move onto the next piece of artwork to download, or if it was the last artwork that it failed on, then it will just return and add the Steam shortcut as normal.

If artwork fails, this PR will be especially useful once we can get AppIDs for Non-Steam Games. The user can see the artwork failed to download and they can retry on the AppID.


Shellcheck is green on this, but I want to do a little more testing before merging, probably tomorrow at this point.

TODO:

  • More testing
  • Bump version

@sonic2kk
Copy link
Owner Author

Tested and this works with ansg and sgdb commands, so this should be good to merge. Shellcheck is green and version is bumped!

@sonic2kk
Copy link
Owner Author

We should consider implementing a timeout and retry elsewhere in the codebase as well, but that could go in a future PR (even better from a community member -- it would be a good way to start contributing!)

@sonic2kk sonic2kk merged commit add8aef into master Oct 23, 2023
@sonic2kk sonic2kk linked an issue Oct 23, 2023 that may be closed by this pull request
11 tasks
@sonic2kk sonic2kk deleted the sgdb-retry-timeout branch October 24, 2023 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Overhaul SteamGridDB Integration
1 participant