Skip to content

Commit 8a0400a

Browse files
committed
GameList: Don't try to scan gpudump files
1 parent bcd4b91 commit 8a0400a

3 files changed

Lines changed: 16 additions & 19 deletions

File tree

src/core/game_list.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ bool GameList::IsScannableFilename(std::string_view path)
177177
if (StringUtil::EndsWithNoCase(path, ".bin"))
178178
return false;
179179

180-
return System::IsLoadablePath(path);
180+
return (System::IsDiscPath(path) || System::IsExePath(path) || System::IsPsfPath(path));
181181
}
182182

183183
bool GameList::ShouldLoadAchievementsProgress()
@@ -501,7 +501,7 @@ void GameList::ScanDirectory(const char* path, bool recursive, bool only_cache,
501501
const Achievements::ProgressDatabase& achievements_progress,
502502
BinaryFileWriter& cache_writer, ProgressCallback* progress)
503503
{
504-
INFO_LOG("Scanning {}{}", path, recursive ? " (recursively)" : "");
504+
VERBOSE_LOG("Scanning {}{}", path, recursive ? " (recursively)" : "");
505505

506506
progress->SetStatusText(SmallString::from_format(TRANSLATE_FS("GameList", "Scanning directory '{}'..."), path));
507507

@@ -577,7 +577,7 @@ bool GameList::ScanFile(std::string path, std::time_t timestamp, std::unique_loc
577577
// don't block UI while scanning
578578
lock.unlock();
579579

580-
DEV_LOG("Scanning '{}'...", path);
580+
VERBOSE_LOG("Scanning '{}'...", path);
581581

582582
Entry entry;
583583
if (!PopulateEntryFromPath(path, &entry))

src/core/system.cpp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,15 @@ bool System::IsUsingPS2BIOS()
800800
return (s_state.bios_image_info && s_state.bios_image_info->fastboot_patch == BIOS::ImageInfo::FastBootPatch::Type2);
801801
}
802802

803+
bool System::IsDiscPath(std::string_view path)
804+
{
805+
return (StringUtil::EndsWithNoCase(path, ".bin") || StringUtil::EndsWithNoCase(path, ".cue") ||
806+
StringUtil::EndsWithNoCase(path, ".img") || StringUtil::EndsWithNoCase(path, ".iso") ||
807+
StringUtil::EndsWithNoCase(path, ".chd") || StringUtil::EndsWithNoCase(path, ".ecm") ||
808+
StringUtil::EndsWithNoCase(path, ".mds") || StringUtil::EndsWithNoCase(path, ".pbp") ||
809+
StringUtil::EndsWithNoCase(path, ".m3u"));
810+
}
811+
803812
bool System::IsExePath(std::string_view path)
804813
{
805814
return (StringUtil::EndsWithNoCase(path, ".exe") || StringUtil::EndsWithNoCase(path, ".psexe") ||
@@ -820,22 +829,7 @@ bool System::IsGPUDumpPath(std::string_view path)
820829

821830
bool System::IsLoadablePath(std::string_view path)
822831
{
823-
static constexpr const std::array extensions = {
824-
".bin", ".cue", ".img", ".iso", ".chd", ".ecm", ".mds", // discs
825-
".exe", ".psexe", ".ps-exe", ".psx", ".cpe", ".elf", // exes
826-
".psf", ".minipsf", // psf
827-
".psxgpu", ".psxgpu.zst", ".psxgpu.xz", // gpu dump
828-
".m3u", // playlists
829-
".pbp",
830-
};
831-
832-
for (const char* test_extension : extensions)
833-
{
834-
if (StringUtil::EndsWithNoCase(path, test_extension))
835-
return true;
836-
}
837-
838-
return false;
832+
return (IsDiscPath(path) || IsExePath(path) || IsPsfPath(path) || IsGPUDumpPath(path));
839833
}
840834

841835
bool System::IsSaveStatePath(std::string_view path)

src/core/system.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ enum class Taint : u8
118118
MaxCount,
119119
};
120120

121+
/// Returns true if the path is a disc image that we can load.
122+
bool IsDiscPath(std::string_view path);
123+
121124
/// Returns true if the path is a PlayStation executable we can inject.
122125
bool IsExePath(std::string_view path);
123126

0 commit comments

Comments
 (0)