GameList: Add region string/fix cached progress increment

This commit is contained in:
Connor McLaughlin 2022-05-15 18:12:28 +10:00 committed by lightningterror
parent 068ab8ab36
commit f260a8be66
2 changed files with 12 additions and 4 deletions

View File

@ -86,6 +86,13 @@ const char* GameList::EntryTypeToString(EntryType type)
return names[static_cast<int>(type)];
}
const char* GameList::RegionToString(Region region)
{
static std::array<const char*, static_cast<int>(Region::Count)> names = {
{"NTSC-U/C", "NTSC-J", "PAL", "Other"}};
return names[static_cast<int>(region)];
}
const char* GameList::EntryCompatibilityRatingToString(CompatibilityRating rating)
{
// clang-format off
@ -497,11 +504,11 @@ void GameList::ScanDirectory(const char* path, bool recursive, const std::vector
{
std::unique_lock lock(s_mutex);
if (GetEntryForPath(ffd.FileName.c_str()))
continue;
if (AddFileFromCache(ffd.FileName, ffd.ModificationTime))
if (GetEntryForPath(ffd.FileName.c_str()) || AddFileFromCache(ffd.FileName, ffd.ModificationTime))
{
progress->IncrementProgressValue();
continue;
}
}
// ownership of fp is transferred

View File

@ -69,6 +69,7 @@ namespace GameList
};
const char* EntryTypeToString(EntryType type);
const char* RegionToString(Region region);
const char* EntryCompatibilityRatingToString(CompatibilityRating rating);
bool IsScannableFilename(const std::string& path);