summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-03-22 11:59:00 +0100
committerTheTroll <trolldev@gmail.com>2010-03-22 11:59:00 +0100
commit8658d9676d68c228a1ecbff795aad99a8eec8f04 (patch)
treef2e20d5ced6d5c2522d82549394e8faf42e5bc6b /bin
parent746232eec6b8e1c6a535ba9810301a128977f5e8 (diff)
downloadistreamdev-8658d9676d68c228a1ecbff795aad99a8eec8f04.tar.gz
istreamdev-8658d9676d68c228a1ecbff795aad99a8eec8f04.tar.bz2
Now extract channum from channels.conf #302
Diffstat (limited to 'bin')
-rwxr-xr-xbin/vdr.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/vdr.php b/bin/vdr.php
index fa573da..751ae32 100755
--- a/bin/vdr.php
+++ b/bin/vdr.php
@@ -105,10 +105,16 @@ function vdrgetchannels($category, $now)
if ($now)
$epgnow = vdrsendcommand("LSTE NOW");
+ $channum = 1;
+
while ($line = fgets($fp, 1024))
{
if (!$cat_found)
{
+ // 2 case where we dont increment channum
+ if (! (($line[0] == "") || (($line[0] == ":") && ($line[1] != "@"))) )
+ $channum++;
+
if ($line[0] != ":")
continue;
@@ -118,6 +124,8 @@ function vdrgetchannels($category, $now)
{
$catarray = explode(' ', $cat);
$cat = substr($cat, strlen($catarray[0])+1);
+
+ $channum = substr($catarray[0], 1);
}
if (!is_utf8($cat))
@@ -137,7 +145,7 @@ function vdrgetchannels($category, $now)
$tmpchan = array();
$tmpchan['name'] = $channame;
- $tmpchan['number'] = vdrgetchannum($channame);
+ $tmpchan['number'] = $channum;
if ($now)
{
// Extract now
@@ -180,6 +188,8 @@ function vdrgetchannels($category, $now)
$tmpchan['name'] = utf8_encode($tmpchan['name']);
$chanlist[] = $tmpchan;
+
+ $channum++;
}
}