From: Christian Weiske Date: Tue, 14 Jan 2020 19:20:09 +0000 (+0100) Subject: do not show "Make" apps in discover X-Git-Tag: v1.0.0~16 X-Git-Url: https://git.cweiske.de/stouyapi.git/commitdiff_plain/a2ab16cfec3ac79d5b293c135e5430b07d617e3f do not show "Make" apps in discover --- diff --git a/bin/filters.php b/bin/filters.php index 07a00bb..703114a 100644 --- a/bin/filters.php +++ b/bin/filters.php @@ -10,12 +10,18 @@ function filterByAge($origGames, $age) return $filtered; } -function filterByGenre($origGames, $genre) +function filterByGenre($origGames, $genre, $remove = false) { $filtered = []; foreach ($origGames as $game) { - if (array_search($genre, $game->genres) !== false) { - $filtered[] = $game; + if ($remove) { + if (array_search($genre, $game->genres) === false) { + $filtered[] = $game; + } + } else { + if (array_search($genre, $game->genres) !== false) { + $filtered[] = $game; + } } } return $filtered; diff --git a/bin/import-game-data.php b/bin/import-game-data.php index cf6a047..2d0076e 100755 --- a/bin/import-game-data.php +++ b/bin/import-game-data.php @@ -77,14 +77,6 @@ foreach ($gameFiles as $gameFile) { 'api/v1/games/' . $game->packageName . '/purchases', buildPurchases($game) ); - /**/ - - /* this crashes babylonian twins - writeJson( - 'api/v1/games/' . $game->packageName . '/purchases', - "{}\n" - ); - */ writeJson( 'api/v1/apps/' . $game->packageName . '.json', @@ -134,6 +126,7 @@ writeJson( function buildDiscover(array $games) { + $games = removeMakeGames($games); $data = [ 'title' => 'DISCOVER', 'rows' => [], @@ -774,6 +767,11 @@ function getPromotedProduct($game) return null; } +function removeMakeGames(array $games) +{ + return filterByGenre($games, 'Tutorials', true); +} + function removeMakeGenres($genres) { $filtered = [];