xmltv/grab/uk_atlas tv_grab_uk_atlas,1.27,1.28

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

Modified Files:
	tv_grab_uk_atlas 
Log Message:
(minor) prevent grabbing > 14 days' data (source site limit)

Index: tv_grab_uk_atlas
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/uk_atlas/tv_grab_uk_atlas,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** tv_grab_uk_atlas	28 Aug 2014 13:45:13 -0000	1.27
--- tv_grab_uk_atlas	23 Oct 2014 08:45:39 -0000	1.28
***************
*** 73,76 ****
--- 73,84 ----
  
  
+ # ------------------------------------------------------------------------------------------------------------------------------------- #
+ # Grabber limits
+ 
+ # Atlas now produces an error if you ask for more than 14 days' worth of data (a strict 14*24 policy; i.e. with no accounting for BST->GMT transition)
+ my $MAX_DAYS_TO_GRAB = 14;
+ 
+ 
+ 
  # Options.pm hi-jacks the --help arg and creates its own POD synopsis!  This means we can't tell people about our added
  #  parameters.  I would posit that's a bug.  Let's redefine the PrintUsage to our POD.
***************
*** 270,273 ****
--- 278,284 ----
  			$to += 3600  if ($opt->{dst});
  			
+ 			# Check we are within source site's max limit
+ 			$to = min($to, $from + ($MAX_DAYS_TO_GRAB * 86400));
+ 			
  			# Store the Start/Stop times for grabbing
  			$starttime = $from;
***************
*** 1586,1589 ****
--- 1597,1608 ----
  }
  
+ sub max ($$) { 
+   return $_[$_[0] < $_[1]];
+ }
+ 
+ sub min ($$) { 
+   return $_[$_[0] > $_[1]];
+ }
+ 
  sub t {
      my( $message ) = @_;


------------------------------------------------------------------------------
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.