From 1fcf072e7d5642aa7a2da75d6698982627e245fd Mon Sep 17 00:00:00 2001 From: TheTroll Date: Thu, 25 Mar 2010 13:39:15 +0100 Subject: changed getepg format --- bin/jsonapi.php | 2 +- bin/vdr.php | 44 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 11 deletions(-) (limited to 'bin') diff --git a/bin/jsonapi.php b/bin/jsonapi.php index 298806b..d50c762 100755 --- a/bin/jsonapi.php +++ b/bin/jsonapi.php @@ -192,7 +192,7 @@ function getEpg($channel, $time, $day, $programs) { $ret = array(); - $ret['channel'] = vdrgetepg($channel, $time, $day, $programs, 0); + $ret['category'] = vdrgetepg($channel, $time, $day, $programs, 0); return json_encode($ret); } diff --git a/bin/vdr.php b/bin/vdr.php index 849548d..08ee13e 100755 --- a/bin/vdr.php +++ b/bin/vdr.php @@ -343,9 +343,19 @@ function vdrgetfullepgat($channel, $at, $programs) $channelname = vdrgetchanname($channel); } + // Generate the epgout squeletum + $categories = vdrgetcategories(); + for ($i=0; $i $row) - $channum[$key] = $row['number']; + if (count($epgout[$i]['channel'])) + { + $channum = array(); + + // Sort it + foreach ($epgout[$i]['channel'] as $key => $row) + $channum[$key] = $row['number']; - array_multisort($channum, SORT_ASC, $epgout); + array_multisort($channum, SORT_ASC, $epgout[$i]['channel']); + } } return $epgout; -- cgit v1.2.3