Category subtitles config option
[stouyapi.git] / bin / build-html.php
index 3f6fa4b42423a9e105029c3af782e2ad7ea97196..1f6c87cdbf4248a28d0569ad53761171089559dd 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,
@@ -91,6 +92,8 @@ function renderDiscoverFile($discoverFile)
     $json = json_decode(file_get_contents($discoverFile));
 
     $title    = $json->title . ' OUYA games';
+    $subtitle = $json->stouyapi->subtitle ?? null;
+
     $sections = [];
     foreach ($json->rows as $row) {
         $section = (object) [
@@ -159,7 +162,25 @@ function renderGameFile($gameDataFile)
             $appsDir . $json->version->uuid . '-download.json'
         )
     );
+
     $apkDownloadUrl = $downloadJson->app->downloadLink;
+    /*
+    if (isset($json->premium) && $json->premium) {
+        $apkDownloadUrl = null;
+    }
+    */
+    $developerDetailsUrl = null;
+    if (isset($json->developer->url) && $json->developer->url) {
+        $developerDetailsUrl = '../discover/' . str_replace(
+            'ouya://launcher/discover/',
+            '',
+            $json->developer->url
+        ) . '.htm';
+    }
+
+    $internetArchiveUrl = $json->stouyapi->{'internet-archive'} ?? null;
+    $developerUrl       = $json->stouyapi->{'developer-url'} ?? null;
+
     $pushUrl = $GLOBALS['pushToMyOuyaUrl']
         . '?game=' . urlencode($json->apk->package);