TitleDatabase: Don't merge multiple languages into same map

Instead of selecting languages based on the user config at the time
of TitleDatabase creation and merging the different languages into one
map for GC and one map for Wii, have one map for each language, and
have the caller supply the language they want. This makes us not need
the IsGCTitle function, which is inaccurate for IDs that start with D.
This commit is contained in:
JosJuice 2019-02-23 19:18:16 +01:00
parent 8842a0f402
commit 9df763b4ac
6 changed files with 91 additions and 133 deletions

View file

@ -43,6 +43,7 @@
#include "Core/TitleDatabase.h"
#include "Core/WiiUtils.h"
#include "DiscIO/Enums.h"
#include "DiscIO/NANDImporter.h"
#include "DiscIO/WiiSaveBanner.h"
@ -1038,11 +1039,12 @@ void MenuBar::CheckNAND()
{
std::string title_listings;
Core::TitleDatabase title_db;
const DiscIO::Language language = SConfig::GetInstance().GetCurrentLanguage(true);
for (const u64 title_id : result.titles_to_remove)
{
title_listings += StringFromFormat("%016" PRIx64, title_id);
const std::string database_name = title_db.GetChannelName(title_id);
const std::string database_name = title_db.GetChannelName(title_id, language);
if (!database_name.empty())
{
title_listings += " - " + database_name;