diff options
author | Alib <aliboba@free.fr> | 2010-03-25 00:21:45 +0100 |
---|---|---|
committer | Alib <aliboba@free.fr> | 2010-03-25 00:21:45 +0100 |
commit | e9463f2507065cd341b90d401b26d01203c522ed (patch) | |
tree | a2f128dbb86f051c8f7c0687ce43f766839059f5 | |
parent | 498a9fd1d4fdd300555fbc30648679e0a7b1b01b (diff) | |
parent | d8f483cd159d6c9380c58d67cf3029be936cd769 (diff) | |
download | istreamdev-e9463f2507065cd341b90d401b26d01203c522ed.tar.gz istreamdev-e9463f2507065cd341b90d401b26d01203c522ed.tar.bz2 |
Merge branch 'jquery' of projects.vdr-developer.org:istreamdev into jquery
-rwxr-xr-x | bin/vdr.php | 55 |
1 files changed, 21 insertions, 34 deletions
diff --git a/bin/vdr.php b/bin/vdr.php index a1b69e4..39170df 100755 --- a/bin/vdr.php +++ b/bin/vdr.php @@ -318,7 +318,7 @@ function vdrgetepgat($channum, $at) return array($date, $time, $title, $desc, $endtime); } -function vdrgetfullepgat($at, $programs) +function vdrgetfullepgat($channel, $at, $programs) { $chanentry = array(); $chanepg = array(); @@ -326,6 +326,11 @@ function vdrgetfullepgat($at, $programs) $addedchans = array(); + if ($channel != "all") + $channel = vdrgetchanname($channel); + else + $channel = "all"; + // Update EPG is needed if ($_SESSION['fullepg'] == "") $_SESSION['fullepg'] = vdrsendcommand("LSTE"); @@ -341,6 +346,9 @@ function vdrgetfullepgat($at, $programs) $channames = explode(" ", $channame); $channame = substr($channame, strlen($channames[0])+1); + if (($channel != "all") && ($channame != $channel)) + continue; + // Dont add chans twice if (count(preg_grep(quotemeta('"' .$channame .'"'), $addedchans))) continue; @@ -364,9 +372,14 @@ function vdrgetfullepgat($at, $programs) { if ($programscounter && $validchan) { - // Add new entry - $fullepg[] = $chanentry; - $addedchans[] = $chanentry['name']; + if ($channel == "all") + { + // Add new entry + $fullepg[] = $chanentry; + $addedchans[] = $chanentry['name']; + } + else + return $chanentry; } $validchan = 0; @@ -455,39 +468,13 @@ function vdrgetepg($channel, $time, $day, $programs, $extended) // Comput requested date $requesteddate = $currentday + ((int)$day * (3600*24)) + $requestedtime - 3600; - // Single chan case - if ($channel != "all") + if ($extended) { - // Create a new chan entry in epg - $chanentry = array(); - $chanentry['name'] = vdrgetchanname($channel); - $chanentry['number'] = $channel; - $chanentry['category'] = vdrgetchancat($$chanentry['name']); - - $chanentry['epg'] = array(); - - if ($extended) - list ($chanentry['date'], $chanentry['time'], $chanentry['title'], $chanentry['desc']) = vdrgetepgat($channel, "at " .$requesteddate); - else - { - $chanentry['epg'] = array(); - $attime = $requesteddate; - $nbprograms = 0; - while ($nbprograms < $programs) - { - list ($date, $chanepg['time'], $chanepg['title'], $desc, $endtime) = vdrgetepgat($channel, "at " .$attime); - $chanentry['epg'][] = $chanepg; - - $attime = $endtime+1; - $nbprograms ++; - } - } - + list ($chanentry['date'], $chanentry['time'], $chanentry['title'], $chanentry['desc']) = vdrgetepgat($channel, "at " .$requesteddate); return $chanentry; } - - // All chans - return vdrgetfullepgat($requesteddate, $programs); + else + return vdrgetfullepgat($channel, $requesteddate, $programs); } function vdrgetrecinfo($rec) |