GameList: Fix cover image detection based on file title

This commit is contained in:
Connor McLaughlin 2020-11-28 02:04:01 +10:00
parent cf75282078
commit d1a42df121
1 changed files with 3 additions and 1 deletions

View File

@ -1170,12 +1170,14 @@ std::string GameList::GetCoverImagePathForEntry(const GameListEntry* entry) cons
} }
// and the file title if it differs // and the file title if it differs
const std::string_view file_title = GetFileNameFromPath(entry->path.c_str()); const std::string_view file_title = System::GetTitleForPath(entry->path.c_str());
if (!file_title.empty() && entry->title != file_title) if (!file_title.empty() && entry->title != file_title)
{ {
cover_path.Clear(); cover_path.Clear();
cover_path.AppendString(g_host_interface->GetUserDirectory().c_str()); cover_path.AppendString(g_host_interface->GetUserDirectory().c_str());
cover_path.AppendCharacter(FS_OSPATH_SEPERATOR_CHARACTER); cover_path.AppendCharacter(FS_OSPATH_SEPERATOR_CHARACTER);
cover_path.AppendString("covers");
cover_path.AppendCharacter(FS_OSPATH_SEPERATOR_CHARACTER);
cover_path.AppendString(file_title.data(), static_cast<u32>(file_title.size())); cover_path.AppendString(file_title.data(), static_cast<u32>(file_title.size()));
cover_path.AppendCharacter('.'); cover_path.AppendCharacter('.');
cover_path.AppendString(extension); cover_path.AppendString(extension);