From: Christian Weiske Date: Fri, 29 Nov 2019 21:41:08 +0000 (+0100) Subject: add support for linking original and unlocked versions X-Git-Tag: v1.0.0~24 X-Git-Url: https://git.cweiske.de/stouyapi.git/commitdiff_plain/588d488d37350e50d9b2b711fbfbb523f5c50dac add support for linking original and unlocked versions --- diff --git a/bin/import-game-data.php b/bin/import-game-data.php index 75841b6..bb3fef8 100755 --- a/bin/import-game-data.php +++ b/bin/import-game-data.php @@ -298,6 +298,15 @@ function buildDetails($game) } } + $buttons = []; + if (isset($game->links->unlocked)) { + $buttons[] = [ + 'text' => 'Show unlocked', + 'url' => 'ouya://launcher/details?app=' . $game->links->unlocked, + 'bold' => true, + ]; + } + // http://cweiske.de/ouya-store-api-docs.htm#get-https-devs-ouya-tv-api-v1-details return [ 'type' => 'Game', @@ -355,6 +364,7 @@ function buildDetails($game) ], 'promotedProduct' => null, + 'buttons' => $buttons, ]; } @@ -387,6 +397,11 @@ function addDiscoverRow(&$data, $title, $games) } else { //game + if (isset($game->links->original)) { + //do not link unlocked games. + // people an access them via the original games + continue; + } $tilePos = findTile($data['tiles'], $game->packageName); if ($tilePos === null) { $tilePos = count($data['tiles']);