Skip to content

Commit

Permalink
RegTest: Use filename instead of database title
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Nov 29, 2024
1 parent 682ba71 commit ae18db9
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/duckstation-regtest/regtest_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ae18db9

Please sign in to comment.