Implement/complete TitleInfoState

This commit is contained in:
J-D-K
2025-06-12 16:25:22 -04:00
parent 95ecbec3e4
commit 8dd16c12bc
12 changed files with 289 additions and 60 deletions

View File

@@ -21,9 +21,6 @@ data::TitleInfo::TitleInfo(uint64_t applicationID) : m_applicationID(application
if (R_FAILED(nsError) || nsAppControlSize < sizeof(m_data.nacp))
{
// This should be false by default, but just in case.
m_hasData = false;
// This is the lowest four hex values of the title.
std::string applicationIDHex = stringutil::get_formatted_string("%04X", m_applicationID & 0xFFFF);

View File

@@ -342,7 +342,7 @@ static void load_save_data_info(void)
default:
{
// Default is just the ID in the save info struct.
// Default is just the ID in the save info struct. This should be fine for system saves too.
accountID = saveInfo.uid;
}
break;
@@ -383,9 +383,10 @@ static void load_save_data_info(void)
// I feel weird allcating space for this even if it's not used, but whatever.
PdmPlayStatistics stats = {0};
// This should be an OKish way to filter out system titles...
if (titleInfo.has_control_data() &&
R_FAILED(
pdmqryQueryPlayStatisticsByApplicationIdAndUserAccountId(applicationID, accountID, false, &stats)))
if (R_FAILED(pdmqryQueryPlayStatisticsByApplicationIdAndUserAccountId(applicationID,
saveInfo.uid,
false,
&stats)))
{
// This isn't fatal.
logger::log("Error getting play stats for title %016llX!", applicationID);