Show "technical notes" in game descriptions
[stouyapi.git] / bin / import-game-data.php
index 5ee582e9501c18220fa8913f437691ab6f06ea30..98e0a4cd17be207c174aba6b31223f0943613b70 100755 (executable)
@@ -19,6 +19,7 @@ if (!is_file($foldersFile)) {
 
 //default configuration values
 $GLOBALS['baseUrl']      = 'http://ouya.cweiske.de/';
+$GLOBALS['categorySubtitles'] = [];
 $GLOBALS['packagelists'] = [];
 $GLOBALS['urlRewrites']  = [];
 $cfgFile = __DIR__ . '/../config.php';
@@ -290,6 +291,9 @@ function buildDiscoverCategory($name, $games)
         'rows'  => [],
         'tiles' => [],
     ];
+    if (isset($GLOBALS['categorySubtitles'][$name])) {
+        $data['stouyapi']['subtitle'] = $GLOBALS['categorySubtitles'][$name];
+    }
 
     if (count($games) >= 20) {
         addDiscoverRow(
@@ -521,11 +525,18 @@ function buildDetails($game, $linkDeveloperPage = false)
         $iaUrl = dirname($game->latestRelease->url) . '/';
     }
 
+    $description = $game->description;
+    if (isset($game->notes) && trim($game->notes)) {
+        $description = "Technical notes:\r\n" . $game->notes
+            . "\r\n----\r\n"
+            . $description;
+    }
+
     // http://cweiske.de/ouya-store-api-docs.htm#get-https-devs-ouya-tv-api-v1-details
     $data = [
         'type'             => 'Game',
         'title'            => $game->title,
-        'description'      => $game->description,
+        'description'      => $description,
         'gamerNumbers'     => $game->players,
         'genres'           => $game->genres,