summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-03-25 01:18:20 +0100
committerTheTroll <trolldev@gmail.com>2010-03-25 01:18:20 +0100
commit42df25818d1f945a551ef0d52b850344f6dd7abb (patch)
tree1212c2b6f2f814aec632afb21b0f0dfa3ea5c1f1 /bin
parent9dec037a1262bdc3a3f4d7cfe1fe0156db0cd1ba (diff)
downloadistreamdev-42df25818d1f945a551ef0d52b850344f6dd7abb.tar.gz
istreamdev-42df25818d1f945a551ef0d52b850344f6dd7abb.tar.bz2
programs= day or all supported now
Diffstat (limited to 'bin')
-rwxr-xr-xbin/vdr.php49
1 files changed, 35 insertions, 14 deletions
diff --git a/bin/vdr.php b/bin/vdr.php
index 27b1087..f644537 100755
--- a/bin/vdr.php
+++ b/bin/vdr.php
@@ -389,9 +389,12 @@ function vdrgetfullepgat($channel, $at, $programs)
if (!$validchan)
continue;
- // Dont get more programs for current chan
- if ($programscounter >= $programs)
- continue;
+ // Dont get more programs for current chan
+ if (is_numeric($programs))
+ {
+ if ($programscounter >= $programs)
+ continue;
+ }
// Find a new EPG entry
if(ereg("^E", $_SESSION['fullepg'][$i]))
@@ -399,19 +402,32 @@ function vdrgetfullepgat($channel, $at, $programs)
$time = substr($_SESSION['fullepg'][$i], 2);
$timearray = explode(" ", $time);
- // Dont use this one
- if ($timearray[1] < $at)
+ switch ($programs)
{
- $validepg = 0;
+ case "all":
+ $validepg = 1;
+ break;
+ case "day":
+ if (($timearray[1] >= $at) && ($timearray[1] < ($at + 3600*24)))
+ $validepg = 1;
+ else
+ $validepg = 0;
+ break;
+ default:
+ if ($timearray[1] >= $at)
+ $validepg = 1;
+ else
+ $validepg = 0;
+ break;
+ }
+
+ if (!$validepg)
continue;
- }
// New valid epg found
$chanepg['title'] = "";
$chanepg['time'] = date('H\hi', $timearray[1]) ."-" .date('H\hi', $timearray[1]+$timearray[2]);
- $validepg = 1;
-
continue;
}
@@ -456,12 +472,17 @@ function vdrgetepg($channel, $time, $day, $programs, $extended)
// Compute time
$currentdate = gettimeofday();
- // Remove current day minutes
+ // Remove current day seconds
$currentday = $currentdate['sec'] - ($currentdate['sec'] % (3600*24));
-
- $requestedhours = (int) substr($time, 0, 2);
- $requestedmins = (int) substr($time, 2);
- $requestedtime = ($requestedhours * 3600) + ($requestedmins * 60);
+
+ if (is_numeric($programs))
+ {
+ $requestedhours = (int) substr($time, 0, 2);
+ $requestedmins = (int) substr($time, 2);
+ $requestedtime = ($requestedhours * 3600) + ($requestedmins * 60);
+ }
+ else
+ $requestedtime = 0;
// Comput requested date
$requesteddate = $currentday + ((int)$day * (3600*24)) + $requestedtime - 3600;