Do not crash when only few games exist
[stouyapi.git] / bin / build-html.php
index 3f6fa4b..c00f811 100755 (executable)
@@ -62,6 +62,7 @@ function renderAllGamesList($detailsFiles)
             'title'        => $json->title,
             'genres'       => $json->genres,
             'developer'    => $json->developer->name,
+            'developerUrl' => $json->stouyapi->{'developer-url'} ?? null,
             'suggestedAge' => $json->suggestedAge,
             'apkVersion'   => $json->version->number,
             'apkTimestamp' => $json->version->publishedAt,
@@ -159,7 +160,17 @@ function renderGameFile($gameDataFile)
             $appsDir . $json->version->uuid . '-download.json'
         )
     );
+
     $apkDownloadUrl = $downloadJson->app->downloadLink;
+    /*
+    if (isset($json->premium) && $json->premium) {
+        $apkDownloadUrl = null;
+    }
+    */
+
+    $internetArchiveUrl = $json->stouyapi->{'internet-archive'} ?? null;
+    $developerUrl       = $json->stouyapi->{'developer-url'} ?? null;
+
     $pushUrl = $GLOBALS['pushToMyOuyaUrl']
         . '?game=' . urlencode($json->apk->package);