From: Christian Weiske
Date: Thu, 14 May 2020 05:09:02 +0000 (+0200)
Subject: "Push to my OUYA" support
X-Git-Tag: v2.0.0~4
X-Git-Url: https://git.cweiske.de/stouyapi.git/commitdiff_plain/4d2b9288d5403294fe6541358341986910e43c36
"Push to my OUYA" support
---
diff --git a/.gitignore b/.gitignore
index cd66da5..4827cbd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
/config.php
+/data/push-to-my-ouya.sqlite3
/README.html
www/api/v1/apps/
www/api/v1/details-data/
diff --git a/README.rst b/README.rst
index 91d490f..d06a382 100644
--- a/README.rst
+++ b/README.rst
@@ -36,6 +36,7 @@ Apache setup
Virtual host configuration::
Script PUT /empty-json.php
+ Script DELETE /api/v1/queued_downloads_delete.php
``mod_actions`` need to be enabled for apache 2.4.
diff --git a/bin/build-html.php b/bin/build-html.php
index b4561e6..f7f9154 100755
--- a/bin/build-html.php
+++ b/bin/build-html.php
@@ -7,6 +7,13 @@
*/
require_once __DIR__ . '/functions.php';
+//default configuration values
+$GLOBALS['pushToMyOuyaUrl'] = '../push-to-my-ouya.php';
+$cfgFile = __DIR__ . '/../config.php';
+if (file_exists($cfgFile)) {
+ include $cfgFile;
+}
+
$wwwDir = __DIR__ . '/../www/';
$discoverDir = __DIR__ . '/../www/api/v1/discover-data/';
$wwwDiscoverDir = $wwwDir . 'discover/';
@@ -111,6 +118,8 @@ function renderGameFile($gameDataFile)
)
);
$apkDownloadUrl = $downloadJson->app->downloadLink;
+ $pushUrl = $GLOBALS['pushToMyOuyaUrl']
+ . '?game=' . urlencode($json->apk->package);
$navLinks = [];
foreach ($json->genres as $genreTitle) {
diff --git a/config.php.dist b/config.php.dist
index 8c23bd2..5087c22 100644
--- a/config.php.dist
+++ b/config.php.dist
@@ -11,3 +11,4 @@ $GLOBALS['packagelists']["cweiske's picks"] = [
'com.cosmos.babyloniantwins',
'com.inverseblue.skyriders',
];
+$GLOBALS['pushToMyOuyaUrl'] = '../push-to-my-ouya.php';
diff --git a/data/templates/game.tpl.php b/data/templates/game.tpl.php
index 36a1d09..531fb28 100644
--- a/data/templates/game.tpl.php
+++ b/data/templates/game.tpl.php
@@ -75,6 +75,15 @@
= gmdate('Y-m-d', $json->version->publishedAt) ?>
+
+
+
+
+
+