{
$playlists = (object) array(
'games' => array(),
- 'playlists' => array()
+ 'playlists' => array(
+ (object) array(
+ //main playlists in the store?
+ 'name' => null,
+ 'id' => -1,
+ 'image' => null,
+ 'tiles' => array()
+ ),
+ (object) array(
+ //mainpage
+ 'name' => null,
+ 'id' => -2,
+ 'image' => null,
+ 'tiles' => array()
+ )
+ )
);
- //-1 - link to playlists
- //-2 - ????
- //1 - featured
- //2 - trending now
+
+ $mainpage = 0;
$id = 0;
foreach ($this->groupByParent($this->getDirs()) as $dir => $arDirs) {
$plnum = count($playlists->playlists);
'name' => $dir,
'tiles' => array()
);
+ $playlists->playlists[0]->tiles[] = array('playlist' => $id);
+
foreach ($arDirs as $dirInfo) {
$uuid = str_replace(
- '/', '-.-', $this->getRelPath($dirInfo->getPathname())
+ array('/', ' '), array('-.-', '+'),
+ $this->getRelPath($dirInfo->getPathname())
);
$playlists->games[] = (object) array(
'content_rating' => 'Everyone',
- 'image' => $this->getImageUrl($this->getFirstImage($dirInfo)),
+ 'image' => $this->getImageUrl($this->getFirstImage($dirInfo))
+ . '&w=400',
'title' => basename($dirInfo->getPathname()),
'uuid' => $uuid,
'version' => '11111111-0000-1111-0000-111111111111',
$playlists->playlists[$plnum]->tiles[] = (object) array(
'game' => $uuid
);
+
+ if (++$mainpage < 10) {
+ $playlists->playlists[1]->tiles[] = (object) array(
+ 'game' => $uuid
+ );
+ }
}
}