diff --git a/src/core/game_list.cpp b/src/core/game_list.cpp index 2bc0aaae0..8cecdbf34 100644 --- a/src/core/game_list.cpp +++ b/src/core/game_list.cpp @@ -177,7 +177,7 @@ bool GameList::IsScannableFilename(std::string_view path) if (StringUtil::EndsWithNoCase(path, ".bin")) return false; - return System::IsLoadablePath(path); + return (System::IsDiscPath(path) || System::IsExePath(path) || System::IsPsfPath(path)); } bool GameList::ShouldLoadAchievementsProgress() @@ -501,7 +501,7 @@ void GameList::ScanDirectory(const char* path, bool recursive, bool only_cache, const Achievements::ProgressDatabase& achievements_progress, BinaryFileWriter& cache_writer, ProgressCallback* progress) { - INFO_LOG("Scanning {}{}", path, recursive ? " (recursively)" : ""); + VERBOSE_LOG("Scanning {}{}", path, recursive ? " (recursively)" : ""); progress->SetStatusText(SmallString::from_format(TRANSLATE_FS("GameList", "Scanning directory '{}'..."), path)); @@ -577,7 +577,7 @@ bool GameList::ScanFile(std::string path, std::time_t timestamp, std::unique_loc // don't block UI while scanning lock.unlock(); - DEV_LOG("Scanning '{}'...", path); + VERBOSE_LOG("Scanning '{}'...", path); Entry entry; if (!PopulateEntryFromPath(path, &entry)) diff --git a/src/core/system.cpp b/src/core/system.cpp index 1da41587e..ca4e6b022 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -800,6 +800,15 @@ bool System::IsUsingPS2BIOS() return (s_state.bios_image_info && s_state.bios_image_info->fastboot_patch == BIOS::ImageInfo::FastBootPatch::Type2); } +bool System::IsDiscPath(std::string_view path) +{ + return (StringUtil::EndsWithNoCase(path, ".bin") || StringUtil::EndsWithNoCase(path, ".cue") || + StringUtil::EndsWithNoCase(path, ".img") || StringUtil::EndsWithNoCase(path, ".iso") || + StringUtil::EndsWithNoCase(path, ".chd") || StringUtil::EndsWithNoCase(path, ".ecm") || + StringUtil::EndsWithNoCase(path, ".mds") || StringUtil::EndsWithNoCase(path, ".pbp") || + StringUtil::EndsWithNoCase(path, ".m3u")); +} + bool System::IsExePath(std::string_view path) { return (StringUtil::EndsWithNoCase(path, ".exe") || StringUtil::EndsWithNoCase(path, ".psexe") || @@ -820,22 +829,7 @@ bool System::IsGPUDumpPath(std::string_view path) bool System::IsLoadablePath(std::string_view path) { - static constexpr const std::array extensions = { - ".bin", ".cue", ".img", ".iso", ".chd", ".ecm", ".mds", // discs - ".exe", ".psexe", ".ps-exe", ".psx", ".cpe", ".elf", // exes - ".psf", ".minipsf", // psf - ".psxgpu", ".psxgpu.zst", ".psxgpu.xz", // gpu dump - ".m3u", // playlists - ".pbp", - }; - - for (const char* test_extension : extensions) - { - if (StringUtil::EndsWithNoCase(path, test_extension)) - return true; - } - - return false; + return (IsDiscPath(path) || IsExePath(path) || IsPsfPath(path) || IsGPUDumpPath(path)); } bool System::IsSaveStatePath(std::string_view path) diff --git a/src/core/system.h b/src/core/system.h index 35a2f4162..548a35f30 100644 --- a/src/core/system.h +++ b/src/core/system.h @@ -118,6 +118,9 @@ enum class Taint : u8 MaxCount, }; +/// Returns true if the path is a disc image that we can load. +bool IsDiscPath(std::string_view path); + /// Returns true if the path is a PlayStation executable we can inject. bool IsExePath(std::string_view path);