Mailing List archive

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

[vdr] [PATCH] xmltv2vdr-1.0.5 vdr-1.3.x compatible (Was: Re: future of xmltv2vdr?)



* Adrian P Challinor <adrian.challinor@osiris.co.uk> [040309 08:47]:

I have only just started with this. My config is: Linux 2.6.3-4
VDR 1.3.5
XMLTV 0.5.30
XMLTV2VDR 1.0.3

Now, I will admit that I am not at all sure I have configure the XMLTV
version of channels.conf correctly (done first thing in the morning, when
contacts lens have not yet settled - not the best time to do complex editing
of the file).
Do it again more carefully and you'll realise it's not that complex :)

Q: Does XMLTV2VDR required the -Psky plugin - a quick scan of the source
implies it might.
No, it doesn't need any plugin.

What I get is an error message: /xmltv2vdr.pl -x channels.xml -c channels.conf
expected SVDRP code 250, but received 451 at ./xmltv2vdr.pl line 56, <SOCK>
line 4.
I send a patch I made to get it to work with vdr-1.3.x and the Spanish
TV grabber. I'm not sure if there was something specific to fix to get
vdr-1.3.x compatibility, but the Spanish grabber produced xml files
without stop time --it only had start times--. At first I thought about
'fixing' the grabber, but on the XMLTV page I shaw the stop time was not
mandatory. Hence I made xmltv2-vdr to calculate it reading the start
time of the following event.

Please, apply this patch and tell me if it works :)

--- xmltv2vdr.pl.orig 2004-03-02 03:58:15.000000000 +0100
+++ xmltv2vdr.pl 2004-02-15 18:15:06.000000000 +0100
@@ -134,14 +134,16 @@

# New XML Program - doesn't handle split programs yet

- if ( ($xmlline =~ /\<programme/ ) && ( $xmlline =~ /$xmltv_channel_name/ ) && ( $xmlline !~ /clumpidx=\"1\/2\"/ ) && ( ! $chanevent ) )
+ if ( ($xmlline =~ /\<programme/i ) && ( $xmlline =~ /$xmltv_channel_name/ ) && ( $xmlline !~ /clumpidx=\"1\/2\"/ ) && ( ! $chanevent ) )
{ - ( $xmlst, $xmlet ) = (split(/\"/, $xmlline))[1,3];
- $vdrst = &xmltime2vdr($xmlst);
- $vdret = &xmltime2vdr($xmlet);
- if ( $vdret )
- # If we parsed an ending time from the line analyzed, we do not need to seek further
+ if ( $xmlline =~ /start=(['"])([-+\s\d]+)\1/i )
{
+ $vdrst = &xmltime2vdr($2)
+ #print "vdrst=$vdrst\n\$1=$1\n\$2=$2\n";
+ }
+ if ( $xmlline =~ /stop=(['"])([-+\s\d]+)\1/i )
+ {
+ $vdret = &xmltime2vdr($2)
# But only if the event is not yet finished we consider the info complete
$chanevent = 1 if ( $vdret > time() );
}
@@ -154,18 +159,17 @@
if ( ($xmlline_next =~ /\<programme/ ) && ( $xmlline_next =~ /$xmltv_channel_name/ ) && ( $xmlline_next !~ /clumpidx=\"1\/2\"/ ) )
# We found a future event from which we'll use the start time as ending time of our still studied one
{
- $xmlet = (split(/\"/, $xmlline_next))[1];
- $vdret = &xmltime2vdr($xmlet);
+ $vdret = &xmltime2vdr($2) if $xmlline_next =~ /start=(['"])([-+\s\d]+)\1/i;
# Only if the event is not yet finished, that is, this next event
# has not started, we tag the info as complete
- $chanevent = 1 if ( $vdret > time() );
+ $chanevent = 1;
# In any case, getting here means we found one future event, whether
# it already started or not, we must not look up any further
last;
}
}
}
- if ( $chanevent )
+ if ( 1 )
# Only when we have complete info about an event, we send it to vdr
{
$vdrdur = $vdret - $vdrst;


It's amazing how much better you feel once you've given up hope.

--
Javier Marcet <javier@marcet.info>


--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index