mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-04-06 03:58:02 +08:00
Remove missed 3DSX support code, add TitleDB version string to info display.
This commit is contained in:
parent
6bf2ce54ce
commit
08db0244aa
@ -60,7 +60,7 @@ static void task_populate_titledb_thread(void* arg) {
|
||||
char* text = (char*) calloc(sizeof(char), maxTextSize);
|
||||
if(text != NULL) {
|
||||
u32 textSize = 0;
|
||||
if(R_SUCCEEDED(res = task_populate_titledb_download(&textSize, text, maxTextSize, "https://api.titledb.com/v1/cia?only=id&only=size&only=updated_at&only=titleid&only=name_s&only=name_l&only=publisher"))) {
|
||||
if(R_SUCCEEDED(res = task_populate_titledb_download(&textSize, text, maxTextSize, "https://api.titledb.com/v1/cia?only=id&only=size&only=updated_at&only=titleid&only=version&only=name_s&only=name_l&only=publisher"))) {
|
||||
json_value* json = json_parse(text, textSize);
|
||||
if(json != NULL) {
|
||||
if(json->type == json_array) {
|
||||
@ -88,6 +88,8 @@ static void task_populate_titledb_thread(void* arg) {
|
||||
strncpy(titledbInfo->updatedAt, subVal->u.string.ptr, sizeof(titledbInfo->updatedAt));
|
||||
} else if(strncmp(name, "titleid", nameLen) == 0) {
|
||||
titledbInfo->titleId = strtoull(subVal->u.string.ptr, NULL, 16);
|
||||
} else if(strncmp(name, "version", nameLen) == 0) {
|
||||
strncpy(titledbInfo->version, subVal->u.string.ptr, sizeof(titledbInfo->version));
|
||||
} else if(strncmp(name, "name_s", nameLen) == 0) {
|
||||
strncpy(titledbInfo->meta.shortDescription, subVal->u.string.ptr, sizeof(titledbInfo->meta.shortDescription));
|
||||
} else if(strncmp(name, "name_l", nameLen) == 0) {
|
||||
@ -122,7 +124,7 @@ static void task_populate_titledb_thread(void* arg) {
|
||||
list_item* currItem = (list_item*) linked_list_iter_next(&iter);
|
||||
titledb_info* currTitledbInfo = (titledb_info*) currItem->data;
|
||||
|
||||
if(titledbInfo->titleId == currTitledbInfo->titleId && (titledbInfo->type == TITLEDB_TYPE_CIA || strncmp(titledbInfo->meta.shortDescription, currTitledbInfo->meta.shortDescription, sizeof(titledbInfo->meta.shortDescription)) == 0)) {
|
||||
if(titledbInfo->titleId == currTitledbInfo->titleId) {
|
||||
if(strncmp(titledbInfo->updatedAt, currTitledbInfo->updatedAt, sizeof(titledbInfo->updatedAt)) >= 0) {
|
||||
linked_list_iter_remove(&iter);
|
||||
task_free_titledb(currItem);
|
||||
|
@ -74,6 +74,7 @@ typedef struct file_info_s {
|
||||
typedef struct titledb_info_s {
|
||||
u32 id;
|
||||
u64 titleId;
|
||||
char version[32];
|
||||
u16 installedVersion;
|
||||
u64 size;
|
||||
char updatedAt[32];
|
||||
|
@ -620,10 +620,12 @@ void ui_draw_titledb_info(ui_view* view, void* data, float x1, float y1, float x
|
||||
|
||||
snprintf(infoText, sizeof(infoText),
|
||||
"Title ID: %016llX\n"
|
||||
"TitleDB Version: %s\n"
|
||||
"Installed Version: %hu (%d.%d.%d)\n"
|
||||
"Size: %.2f %s\n"
|
||||
"Updated At: %s %s",
|
||||
info->titleId,
|
||||
info->version,
|
||||
info->installedVersion, (info->installedVersion >> 10) & 0x3F, (info->installedVersion >> 4) & 0x3F, info->installedVersion & 0xF,
|
||||
util_get_display_size(info->size), util_get_display_size_units(info->size),
|
||||
updatedDate, updatedTime);
|
||||
|
Loading…
x
Reference in New Issue
Block a user