Block until game info is ready in LaunchFile

When launching a file from outside the main screen (file association, shortcut,
drag-and-drop), the info hasn't been computed yet, so the file type and ID checks
that decide what to do with the file were reading empty data. Add
GameInfo::WaitUntilReady() - a condition variable signalled from
MarkReadyNoLock(), which every exit path of the work item goes through - and use
it there.

Also demote a noisy PRX decryption log line to DEBUG.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EMLTdwyyzU6Mze3w8VC2JL
This commit is contained in:
Henrik Rydgård
2026-08-24 17:23:20 +02:00
co-authored by Claude Opus 5
parent cc1cdfcec4
commit 65592effc5
3 changed files with 25 additions and 5 deletions
+5 -2
View File
@@ -70,8 +70,11 @@ static void LaunchFile(ScreenManager *screenManager, Screen *currentScreen, cons
} else {
// 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, we probably technically should wait for it...
auto info = g_gameInfoCache->GetInfo(nullptr, path, GameInfoFlags::FILE_TYPE | GameInfoFlags::PARAM_SFO);
// 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.
const GameInfoFlags neededFlags = GameInfoFlags::FILE_TYPE | GameInfoFlags::PARAM_SFO;
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(nullptr, path, neededFlags);
info->WaitUntilReady(neededFlags);
switch (info->fileType) {
case IdentifiedFileType::PSP_UMD_VIDEO_ISO: