From: Christian Weiske Date: Wed, 27 May 2020 20:14:35 +0000 (+0200) Subject: Link game pages to internet archive X-Git-Tag: v3.0.0~38 X-Git-Url: https://git.cweiske.de/stouyapi.git/commitdiff_plain/8b8ab49648debc6dd813b02094913a5ebb8167c0?ds=sidebyside Link game pages to internet archive --- diff --git a/bin/build-html.php b/bin/build-html.php index 3f6fa4b..18e25e5 100755 --- a/bin/build-html.php +++ b/bin/build-html.php @@ -159,7 +159,16 @@ function renderGameFile($gameDataFile) $appsDir . $json->version->uuid . '-download.json' ) ); + $apkDownloadUrl = $downloadJson->app->downloadLink; + /* + if (isset($json->premium) && $json->premium) { + $apkDownloadUrl = null; + } + */ + + $internetArchiveUrl = $json->stouyapi->{'internet-archive'} ?? null; + $pushUrl = $GLOBALS['pushToMyOuyaUrl'] . '?game=' . urlencode($json->apk->package); diff --git a/bin/import-game-data.php b/bin/import-game-data.php index 11ed6b3..cfd1630 100755 --- a/bin/import-game-data.php +++ b/bin/import-game-data.php @@ -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,10 @@ function buildDetails($game) 'promotedProduct' => $product, 'buttons' => $buttons, + + 'stouyapi' => [ + 'internet-archive' => $iaUrl, + ] ]; } diff --git a/data/templates/game.tpl.php b/data/templates/game.tpl.php index 60f9326..ce9c561 100644 --- a/data/templates/game.tpl.php +++ b/data/templates/game.tpl.php @@ -68,6 +68,7 @@

Links

+
Download .apk

@@ -75,6 +76,12 @@ version->publishedAt) ?>

+ + +
+ Internet Archive page +
+