v2.9.1: Shop im eShop-Stil mit Screenshots und Suche, GodMode9-Skript zum Installieren

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nico Meister
2026-10-18 18:31:41 +02:00
co-authored by Claude Opus 5.5
parent ca77952a9d
commit 1f69ff6c56
8 changed files with 687 additions and 194 deletions
+12 -4
View File
@@ -96,7 +96,9 @@ static bool parse_list(char *text, int *revision)
{
char *save = NULL, *line = strtok_r(text, "\n", &save);
char *f[16];
if (!line || split(line, f, 16) < 5 || strcmp(f[0], "MBMNETSHOP") != 0) return false;
if (!line || split(line, f, 20) < 5 || strcmp(f[0], "MBMNETSHOP") != 0) return false;
int format = atoi(f[1]);
int fields = format >= 2 ? 17 : 13;
*revision = atoi(f[2]);
int count = atoi(f[3]);
sheetCount = atoi(f[4]);
@@ -107,7 +109,7 @@ static bool parse_list(char *text, int *revision)
appCount = 0;
while ((line = strtok_r(NULL, "\n", &save)) && appCount < count) {
if (split(line, f, 16) < 13) continue;
if (split(line, f, 20) < fields) continue;
App *a = &apps[appCount++];
COPY(a->slug, f[0]);
COPY(a->title, f[1]);
@@ -121,7 +123,13 @@ static bool parse_list(char *text, int *revision)
a->size = strtoul(f[9], NULL, 10);
a->stars = strtoul(f[10], NULL, 10);
COPY(a->updated, f[11]);
a->description = strdup(f[12]);
if (format >= 2) {
a->shots = atoi(f[12]);
a->banner = f[13][0] == '1';
a->colorBg = f[14][0] == '#' ? strtoul(f[14] + 1, NULL, 16) : 0;
COPY(a->license, f[15]);
}
a->description = strdup(f[fields - 1]);
}
return appCount > 0;
}
@@ -207,7 +215,7 @@ static void catalog_worker(void *arg)
mkdir(SHOP_DIR, 0777);
snprintf(catMsg, sizeof(catMsg), "Lade den Katalog ...");
snprintf(url, sizeof(url), "http://%s/shop/list", SHOP_SERVER);
snprintf(url, sizeof(url), "http://%s/shop/list2", SHOP_SERVER);
u32 status = net_get(url, &data, &size, 4 * 1024 * 1024, &rc);
char *text = NULL;
if (status == 200 && size > 10) {