git.cweiske.de
/
stouyapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f0f9c1d
)
Special first row handling for genres with < 20 games
master
github/master
author
Christian Weiske
<cweiske@cweiske.de>
Thu, 13 Nov 2025 19:54:55 +0000
(20:54 +0100)
committer
Christian Weiske
<cweiske@cweiske.de>
Thu, 13 Nov 2025 19:54:55 +0000
(20:54 +0100)
bin/import-game-data.php
patch
|
blob
|
history
diff --git
a/bin/import-game-data.php
b/bin/import-game-data.php
index 079fa47aa30dc6a0e1895012e35777ae59f64cc8..67d78a50fd503f22549169013064d9bbb61de432 100755
(executable)
--- 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];
}
$data['stouyapi']['subtitle'] = $GLOBALS['categorySubtitles'][$name];
}
+ $specialRows = false;
if (count($games) >= 20) {
if (count($games) >= 20) {
+ $specialRows = true;
addDiscoverRow(
$data, 'Last updated',
filterLastUpdated($games, 10)
addDiscoverRow(
$data, 'Last updated',
filterLastUpdated($games, 10)
@@
-354,7
+356,18
@@
function buildDiscoverCategory($name, $games)
}
$games = sortByTitle($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);
$title = 'All';
foreach ($chunks as $chunkGames) {
addDiscoverRow($data, $title, $chunkGames);