xmltv/grab/pt tv_grab_pt,1.52,1.53

Geoff <[email protected]>
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/grab/pt
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32155

Modified Files:
	tv_grab_pt 
Log Message:
fix 'no programmes' when month changes on website schedule

Index: tv_grab_pt
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/pt/tv_grab_pt,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** tv_grab_pt	19 May 2014 14:36:01 -0000	1.52
--- tv_grab_pt	31 May 2014 19:29:48 -0000	1.53
***************
*** 446,449 ****
--- 446,450 ----
  
  	my $programmes = {};
+ 	my $firstdaynum;
  	
  	if ( my $h = $tree->look_down('_tag' => 'div', 'id' => 'programs-container') ) {
***************
*** 451,457 ****
  			DAY:
  			foreach my $h_day (@h2) {       # schedule for a day
! 				my ($daynum) = $h_day->attr('id') =~ /day(\d*)/;
  				
! 				my $dt = $today_date->set_day($daynum);
  				#print STDERR "\n" . $dt->strftime("%Y%m%d%H%M%S %z") . "\n";
  				
--- 452,460 ----
  			DAY:
  			foreach my $h_day (@h2) {       # schedule for a day
! 				my ($daynum) = $h_day->attr('id') =~ /day(\d*)/;		
! 				$firstdaynum = $daynum if !defined $firstdaynum;
  				
! 				my $dt = $today_date->clone()->set_day($daynum);
! 				$dt->add( months => 1 )  if $daynum < $firstdaynum;
  				#print STDERR "\n" . $dt->strftime("%Y%m%d%H%M%S %z") . "\n";
  				


------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.