From 17ac5ffe998ca248cdcd424f80e68af9bcb19af7 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 17 Sep 2022 17:46:35 +1000 Subject: [PATCH] GameList: Use sanitized game titles for covers Fixes covers for games such as dot hack which use characters incompatble with the file system. --- pcsx2/Frontend/GameList.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pcsx2/Frontend/GameList.cpp b/pcsx2/Frontend/GameList.cpp index 8c757aae26..92644fd3a1 100644 --- a/pcsx2/Frontend/GameList.cpp +++ b/pcsx2/Frontend/GameList.cpp @@ -766,7 +766,8 @@ std::string GameList::GetCoverImagePath(const std::string& path, const std::stri // Last resort, check the game title if (!title.empty()) { - const std::string cover_filename(title + extension); + std::string cover_filename(title + extension); + Path::SanitizeFileName(&cover_filename); cover_path = Path::Combine(EmuFolders::Covers, cover_filename); if (FileSystem::FileExists(cover_path.c_str())) return cover_path; @@ -791,6 +792,7 @@ std::string GameList::GetNewCoverImagePathForEntry(const Entry* entry, const cha return existing_filename; } - const std::string cover_filename(entry->title + extension); + std::string cover_filename(entry->title + extension); + Path::SanitizeFileName(&cover_filename); return Path::Combine(EmuFolders::Covers, cover_filename); }