GameList: Add option to download all game icons#3655
Conversation
|
Wouldn't a better implementation be to do this when the user calls "Refresh Achievement Progress" from View menu? Maybe it's not as obvious, but I think it's justified by less UI pollution. Would it affect the task speed significantly for large libraries? |
|
@JukePlz Sure, that would cut down on UI pollution. I initially created it in a separate option to prevent it from being intrusive to the user. But on the other hand, the user can just press Cancel to abort the icon-downloading operation. For a library of 50, it takes around 3 seconds. But it's a one-off operation, after these game badges are cached, it will detect that all games have an icon and don't need redownloading. |
stenzek
left a comment
There was a problem hiding this comment.
I'd prefer it be a separate action. It really is a different operation - this one could take some time depending on the number of games (and thus needs progress), whereas the progress refresh is near-instant.
| progress->SetStatusText(fmt::format("Fetching icon info for {} games...", game_ids.size()).c_str()); | ||
|
|
||
| // Create HTTP downloader | ||
| std::unique_ptr<HTTPDownloader> http = HTTPDownloader::Create(Host::GetHTTPUserAgent()); |
There was a problem hiding this comment.
This can use the existing downloader for achievements if they're active, but that's a larger change - I can handle that afterwards - saves creating a worker thread.
There was a problem hiding this comment.
Yeah I really wanted to simplify this. If you can handle it, that'd be great.
| http->SetTimeout(30.0f); | ||
|
|
||
| // Fetch game titles (includes badge names) from RetroAchievements | ||
| rc_api_fetch_game_titles_request_t titles_request; |
There was a problem hiding this comment.
This really should be implemented in rc_client, I'm trying to avoid using rc_api directly. But again, I can do that post-merge.
There was a problem hiding this comment.
I like the sound of that. Then other consumers would be able to use it too.
EDIT:
Is this what you meant? RetroAchievements/rcheevos#484
If so, then the code in achievements.cpp can be reduced down to this: mariobob#1 (this is just a preview, I'll be able to create a real PR once the current once is merged)
f92af10 to
9089662
Compare
Added new functionality to downloads game icons from RetroAchievements for all games in the library missing icons, without needing to open each game individually. The functionality is attached to the existing option "Refresh Achievement Progress" in the View menu.
When triggered, a progress bar displays the batch download status:
Background
When a game is opened, DuckStation automatically downloads its icon from RetroAchievements and caches it. However, for users with large libraries, this means icons only appear after each game has been launched at least once.
Changes
Achievements::DownloadGameIcons()which uses therc_api_fetch_game_titlesAPI to batch-fetch badge information for all games with achievement data, then downloads missing icons