Show numbers for ranked games
authorChristian Weiske <cweiske@cweiske.de>
Sun, 27 Dec 2020 07:23:38 +0000 (08:23 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Sun, 27 Dec 2020 07:23:38 +0000 (08:23 +0100)
bin/import-game-data.php

index 585c288bab716210bacd163bbdd51148a43c6afc..b6c1917783d428ebee19c714fb993301dcf44d35 100755 (executable)
@@ -112,7 +112,6 @@ foreach ($developers as $developer) {
         buildDeveloperProducts($developer['products'], $developer['info'])
     );
     writeJson(
-        //index.htm does not need a rewrite rule
         'api/v1/developers/' . $developer['info']->uuid
         . '/current_gamer',
         buildDeveloperCurrentGamer()
@@ -153,7 +152,8 @@ function buildDiscover(array $games)
     );
     addDiscoverRow(
         $data, 'Best rated',
-        filterBestRated($games, 10)
+        filterBestRated($games, 10),
+        true
     );
 
     foreach ($GLOBALS['packagelists'] as $listTitle => $listPackageNames) {
@@ -250,7 +250,8 @@ function buildDiscoverCategory($name, $games)
     );
     addDiscoverRow(
         $data, 'Best rated',
-        filterBestRated($games, 10)
+        filterBestRated($games, 10),
+        true
     );
 
     $games = sortByTitle($games);
@@ -640,12 +641,12 @@ function addChunkedDiscoverRows(&$data, $games, $title)
     }
 }
 
-function addDiscoverRow(&$data, $title, $games)
+function addDiscoverRow(&$data, $title, $games, $ranked = false)
 {
     $row = [
         'title'     => $title,
         'showPrice' => true,
-        'ranked'    => false,
+        'ranked'    => $ranked,
         'tiles'     => [],
     ];
     foreach ($games as $game) {