diff options
| author | Christian Weiske <[email protected]> | 2025-11-13 20:54:55 +0100 |
|---|---|---|
| committer | Christian Weiske <[email protected]> | 2025-11-13 20:54:55 +0100 |
| commit | 4ffe9fffc3808e92804c657435c0cd730ed30319 (patch) | |
| tree | d8f18a0be49a3f1a0b59db3fb20ec8610920409f | |
| parent | f0f9c1de49e3a688793dcbea2ae5f7feaeb40e70 (diff) | |
| download | stouyapi-master.tar.gz stouyapi-master.zip | |
| -rwxr-xr-x | bin/import-game-data.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/import-game-data.php b/bin/import-game-data.php index 079fa47..67d78a5 100755 --- a/bin/import-game-data.php +++ b/bin/import-game-data.php @@ -341,7 +341,9 @@ function buildDiscoverCategory($name, $games) $data['stouyapi']['subtitle'] = $GLOBALS['categorySubtitles'][$name]; } + $specialRows = false; if (count($games) >= 20) { + $specialRows = true; addDiscoverRow( $data, 'Last updated', filterLastUpdated($games, 10) @@ -354,7 +356,18 @@ function buildDiscoverCategory($name, $games) } $games = sortByTitle($games); - $chunks = array_chunk($games, 4); + if ($specialRows) { + $chunks = array_chunk($games, 4); + } else { + //first row has large images, only 3 games are visible + // so only put 3 in the first row. + $chunks = [ + array_slice($games, 0, 3) + ]; + $games = array_slice($games, 3); + $chunks = array_merge($chunks, array_chunk($games, 4)); + } + $title = 'All'; foreach ($chunks as $chunkGames) { addDiscoverRow($data, $title, $chunkGames); |
