From 8658d9676d68c228a1ecbff795aad99a8eec8f04 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Mon, 22 Mar 2010 11:59:00 +0100 Subject: Now extract channum from channels.conf #302 --- bin/vdr.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'bin') 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++; } } -- cgit v1.2.3