summaryrefslogtreecommitdiff
path: root/bin/vdr.php
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-03-25 11:29:48 +0100
committerTheTroll <trolldev@gmail.com>2010-03-25 11:29:48 +0100
commitc0ed6d245d377b640a28d3a675397542465e4587 (patch)
treeb65e6e01429b18c3685d21af9bbedfe50faa1058 /bin/vdr.php
parentc8b1c84b1adae391902960e918f659b51be13f46 (diff)
downloadistreamdev-c0ed6d245d377b640a28d3a675397542465e4587.tar.gz
istreamdev-c0ed6d245d377b640a28d3a675397542465e4587.tar.bz2
Support time=now
some fixes
Diffstat (limited to 'bin/vdr.php')
-rwxr-xr-xbin/vdr.php42
1 files changed, 30 insertions, 12 deletions
diff --git a/bin/vdr.php b/bin/vdr.php
index 992877d..075f26b 100755
--- a/bin/vdr.php
+++ b/bin/vdr.php
@@ -410,19 +410,22 @@ function vdrgetfullepgat($channel, $at, $programs)
$time = substr($epgin[$i], 2);
$timearray = explode(" ", $time);
+ $starttime = $timearray[1];
+ $endtime = $timearray[1]+$timearray[2];
+
switch ($programs)
{
case "all":
$validepg = 1;
break;
case "day":
- if (($timearray[1] >= $at) && ($timearray[1] < ($at + 3600*24)))
+ if (($endtime >= $at) && ($starttime < ($at + 3600*24)))
$validepg = 1;
else
$validepg = 0;
break;
default:
- if ($timearray[1] >= $at)
+ if ($endtime >= $at)
$validepg = 1;
else
$validepg = 0;
@@ -482,18 +485,33 @@ function vdrgetepg($channel, $time, $day, $programs, $extended)
// Remove current day seconds
$currentday = $currentdate['sec'] - ($currentdate['sec'] % (3600*24));
-
- if (is_numeric($programs))
+
+ switch ($programs)
{
- $requestedhours = (int) substr($time, 0, 2);
- $requestedmins = (int) substr($time, 2);
- $requestedtime = ($requestedhours * 3600) + ($requestedmins * 60);
- }
- else
- $requestedtime = 0;
+ case "all":
+ // Get all entries
+ $requesteddate = 0;
+ break;
- // Comput requested date
- $requesteddate = $currentday + ((int)$day * (3600*24)) + $requestedtime - 3600;
+ case "day":
+ // Get all day
+ $requesteddate = $currentdate['sec'] - ($currentdate['sec'] % (3600*24)) + ($day * (3600*24));
+ break;
+
+ default:
+ // Get exact time
+ switch ($time)
+ {
+ case "now":
+ $requesteddate = $currentdate['sec'];
+ break;
+ default:
+ $requestedday = $currentdate['sec'] - ($currentdate['sec'] % (3600*24)) + ($day * (3600*24));
+ $requestedtime = ((int) substr($time, 0, 2) * 3600) + ((int) substr($time, 2) * 60);
+ $requesteddate = $requestedday + $requestedtime;
+ break;
+ }
+ }
if ($extended)
{