Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Bug in epg2html



Matthias Fechner wrote:
> 
> Hello Klaus,
> 
> * Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de> [27-05-02 17:28]:
> > The fourth parameter in the E record is the 'table id', which may or may not
> > be present. Therefore epg2html.pl doesn't parse it (it wouldn't have any
> > meaning here, anyway).
> >
> > Are you observing any problem with the original epg2html.pl, which has been
> > fixed by your patch?
> 
> Yes, i have some problems, i use the script to parse the epg.data and
> write all films into a database. For this i use the duration too.
> 
> I used the perldebugger and see, that perl will not set the variables
> correctly. But if i change the regexp, all is working fine.

I found out now why this didn't work in the original epg2html.
The regexp for the third parameter didn't match, so when you added
the fourth one, what actually happened was that the thrid one did
match, but the fourth one didn't. This hasn't been a problem in the
original epg2html, since it didn't do anything with the $Duration,
and I assume that your script didn't do anything with the 'table id'.

The proper fix in order to allow the fourth parameter to be optional
would be:

--- epg2html.pl Tue Feb 26 23:10:47 2002
+++ epg2html.pl Thu May 30 11:43:13 2002
@@ -45,7 +45,7 @@
          push(@Index, qq{<a href="$Page">$Channel</a><br>\n});
          my %Events = ();
          while (<>) {
-               if (/^E (.*?) (.*?) (.*?)/) {
+               if (/^E (.*?) (.*?) ([^ ]*)/) {
                   (my $Time, $Duration) = ($2, $3);
                   my $Title = "", $Subtitle = "", $Description = "";
                   while (<>) {

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________




Home | Main Index | Thread Index