From 8ad0f78ef73065481088a62790f4b18c0bd0d9ab Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 17 Apr 2021 20:06:23 +1000 Subject: [PATCH] CommonHostInterface: Prefer serial from database, not image --- src/frontend-common/common_host_interface.cpp | 10 +++++++--- src/frontend-common/game_list.h | 2 -- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index 80bbcc09d..69e715305 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -2861,15 +2861,19 @@ void CommonHostInterface::GetGameInfo(const char* path, CDImage* image, std::str } else { - if (image) - *code = System::GetGameCodeForImage(image, true); - GameDatabase database; GameDatabaseEntry database_entry; if (database.Load() && database.GetEntryForDisc(image, &database_entry)) + { + *code = std::move(database_entry.serial); *title = std::move(database_entry.title); + } else + { *title = System::GetTitleForPath(path); + if (image) + *code = System::GetGameCodeForImage(image, true); + } } } diff --git a/src/frontend-common/game_list.h b/src/frontend-common/game_list.h index 361d6d969..a362089ab 100644 --- a/src/frontend-common/game_list.h +++ b/src/frontend-common/game_list.h @@ -102,8 +102,6 @@ public: const GameListEntry* GetEntryForPath(const char* path) const; const GameListCompatibilityEntry* GetCompatibilityEntryForCode(const std::string& code) const; - - bool GetGameCodeAndTitleFromDatabase(const char* path, std::string* code, std::string* title); void SetCacheFilename(std::string filename) { m_cache_filename = std::move(filename); } void SetUserCompatibilityListFilename(std::string filename)