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?)



This time I send the patch attached, since the inlined version arrived
with broken lines...


I knew there was "read/write" and "read only" users of comp.os.vms,
but not that there was "write only" users also.

--
Javier Marcet <javier@marcet.info>
--- 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;

Home | Main Index | Thread Index