RegTest: Use filename instead of database title

This commit is contained in:
Stenzek 2024-11-29 19:10:18 +10:00
parent 682ba71319
commit ae18db9271
No known key found for this signature in database
1 changed files with 4 additions and 14 deletions

View File

@ -700,22 +700,12 @@ bool RegTestHost::SetNewDataRoot(const std::string& filename)
return false;
}
const GameDatabase::Entry* dbentry = GameDatabase::GetEntryForDisc(image.get());
std::string_view game_name;
if (dbentry)
{
game_name = dbentry->title;
INFO_LOG("Game name from database: {}", game_name);
}
else
{
game_name = Path::GetFileTitle(filename);
WARNING_LOG("Game not found in database, using filename: {}", game_name);
}
if (!s_dump_base_directory.empty())
{
std::string dump_directory = Path::Combine(s_dump_base_directory, game_name);
std::string game_subdir = Path::SanitizeFileName(Path::GetFileTitle(filename));
INFO_LOG("Writing to subdirectory '{}'", game_subdir);
std::string dump_directory = Path::Combine(s_dump_base_directory, game_subdir);
if (!FileSystem::DirectoryExists(dump_directory.c_str()))
{
INFO_LOG("Creating directory '{}'...", dump_directory);