Add support for a "content rating" field for apps in the homebrew store.

This is to maximize likelihood of passing iOS review.
This commit is contained in:
Henrik Rydgård 2024-05-06 13:50:56 +02:00
parent a5526d3b65
commit a75516f53e
2 changed files with 8 additions and 1 deletions

View File

@ -456,7 +456,7 @@ void StoreScreen::ParseListing(const std::string &json) {
entries_.clear();
for (const JsonNode *pgame : entries->value) {
JsonGet game = pgame->value;
StoreEntry e;
StoreEntry e{};
e.type = ENTRY_PBPZIP;
e.name = GetTranslatedString(game, "name");
e.description = GetTranslatedString(game, "description", "");
@ -464,6 +464,12 @@ void StoreScreen::ParseListing(const std::string &json) {
e.size = game.getInt("size");
e.downloadURL = game.getStringOr("download-url", "");
e.iconURL = game.getStringOr("icon-url", "");
e.contentRating = game.getInt("content-rating", 0);
#if PPSSPP_PLATFORM(IOS_APP_STORE)
if (e.contentRating >= 100) {
continue;
}
#endif
e.hidden = false; // NOTE: Handling of the "hidden" flag is broken in old versions of PPSSPP. Do not use.
const char *file = game.getStringOr("file", nullptr);
if (!file)

View File

@ -54,6 +54,7 @@ struct StoreEntry {
std::string category;
std::string downloadURL; // Only set for games that are not hosted on store.ppsspp.org
bool hidden;
int contentRating; // 100 means to hide it on iOS. No other values defined yet.
u64 size;
};