GameInfoCache: Prioritize loads, so launching doesn't wait behind search

Type-to-search asks for the title of every game in the list, queueing a
load for each, and launching a game whose info wasn't loaded yet then
blocked until the whole queue had drained. Search's loads are now LOW,
and launching asks at HIGH, which queues its own load rather than wait
for a pending one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-09-29 16:34:38 -06:00
1 parent ae460c9e1a
commit 3aaea4c0f9
4 files changed
+27 -10

No files matched your search

+3 -2
View File
@@ -72,9 +72,10 @@ static void LaunchFile(ScreenManager *screenManager, Screen *currentScreen, cons
// Check if we already know that this game isn't playable.
// If coming from the main screen, the info will already be computed here since the icon is displayed etc.
// Otherwise (launching from a file association, a shortcut, drag-and-drop...) we have to block until
// it's available - we can't decide what to do below without it.
// it's available - we can't decide what to do below without it. HIGH, so we don't wait behind
// whatever else is queued, like a search's loads for every game in a big list.
const GameInfoFlags neededFlags = GameInfoFlags::FILE_TYPE | GameInfoFlags::PARAM_SFO;
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(nullptr, path, neededFlags);
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(nullptr, path, neededFlags, nullptr, GameInfoFlags::EMPTY, TaskPriority::HIGH);
info->WaitUntilReady(neededFlags);
switch (info->fileType) {