}
//default configuration values
+$GLOBALS['baseUrl'] = 'http://ouya.cweiske.de/';
+$GLOBALS['categorySubtitles'] = [];
$GLOBALS['packagelists'] = [];
$GLOBALS['urlRewrites'] = [];
$cfgFile = __DIR__ . '/../config.php';
filterLastAdded($games, 10)
);
addDiscoverRow(
- $data, 'Best rated',
- filterBestRated($games, 10),
+ $data, 'Best rated games',
+ filterBestRatedGames($games, 10),
true
);
$data, 'Special',
[
'Best rated',
+ 'Best rated games',
'Most rated',
'Random',
'Last updated',
'api/v1/discover-data/' . categoryPath('Best rated') . '.json',
buildSpecialCategory('Best rated', filterBestRated($games, 99))
);
+ writeJson(
+ 'api/v1/discover-data/' . categoryPath('Best rated games') . '.json',
+ buildSpecialCategory('Best rated games', filterBestRatedGames($games, 99))
+ );
writeJson(
'api/v1/discover-data/' . categoryPath('Most rated') . '.json',
buildSpecialCategory('Most rated', filterMostDownloaded($games, 99))
'rows' => [],
'tiles' => [],
];
- addDiscoverRow(
- $data, 'Last Updated',
- filterLastUpdated($games, 10)
- );
- addDiscoverRow(
- $data, 'Best rated',
- filterBestRated($games, 10),
- true
- );
+ if (isset($GLOBALS['categorySubtitles'][$name])) {
+ $data['stouyapi']['subtitle'] = $GLOBALS['categorySubtitles'][$name];
+ }
+
+ if (count($games) >= 20) {
+ addDiscoverRow(
+ $data, 'Last Updated',
+ filterLastUpdated($games, 10)
+ );
+ addDiscoverRow(
+ $data, 'Best rated',
+ filterBestRated($games, 10),
+ true
+ );
+ }
$games = sortByTitle($games);
$chunks = array_chunk($games, 4);
'fileSize' => $release->size,
'version' => $release->uuid,
'contentRating' => $game->contentRating,
- 'downloadLink' => rewriteUrl($release->url),
+ 'downloadLink' => $release->url,
]
];
}
$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,
'url' => $qrUrlPath,
];
}
+
+ //rewrite urls from Internet Archive to our servers
+ $game->discover = rewriteUrl($game->discover);
+ foreach ($game->media as $medium) {
+ $medium->url = rewriteUrl($medium->url);
+ }
+ foreach ($game->releases as $release) {
+ $release->url = rewriteUrl($release->url);
+ }
}
/**