Use developer URL in game details page and all games list
[stouyapi.git] / bin / import-game-data.php
index 11ed6b38993ba0e3297cad953ffba1bee7d690d3..e90ccc948043cad9b6c13df017c14689bebe4984 100755 (executable)
@@ -449,6 +449,13 @@ function buildDetails($game)
         $product = buildProduct($gamePromoted);
     }
 
+    $iaUrl = null;
+    if (isset($game->latestRelease->url)
+        && substr($game->latestRelease->url, 0, 29) == 'https://archive.org/download/'
+    ) {
+        $iaUrl = dirname($game->latestRelease->url) . '/';
+    }
+
     // http://cweiske.de/ouya-store-api-docs.htm#get-https-devs-ouya-tv-api-v1-details
     return [
         'type'             => 'Game',
@@ -507,6 +514,11 @@ function buildDetails($game)
 
         'promotedProduct' => $product,
         'buttons'         => $buttons,
+
+        'stouyapi' => [
+            'internet-archive' => $iaUrl,
+            'developer-url'    => $game->developer->website ?? null,
+        ]
     ];
 }