From: Nick M. <kno...@us...> - 2007-12-07 10:46:01
|
Update of /cvsroot/xmltv/xmltv/grab/uk_rt In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv3635 Modified Files: tv_grab_uk_rt.in Log Message: Additionally checks for presence of DOCTYPE element in Radio Times data which indicates a lack of usable data. Users wanting to take advantage of tv_grab_uk_rt's bad/missing data support will need to upgrade HTTP::Cache::Transparent to a release later than 0.7 Index: tv_grab_uk_rt.in =================================================================== RCS file: /cvsroot/xmltv/xmltv/grab/uk_rt/tv_grab_uk_rt.in,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** tv_grab_uk_rt.in 7 Dec 2007 10:28:34 -0000 1.127 --- tv_grab_uk_rt.in 7 Dec 2007 10:46:05 -0000 1.128 *************** *** 163,177 **** } ! # Check whether data files on the RT website are empty but still online. # These files will have a good HTTP response header as they exist, but they # contain no data. Caching via HCT without checking for a non-zero content_size # beforehand will therefore overwrite good data with bad. Any file having a ! # content_length of 0 will not be cached and the existing cached copy of the ! # file will be used. This relies on HTTP::Cache::Transparent release > 0.7. # sub check_content_length { my $rt_file = shift @_; if( $rt_file->is_success ) { ! if( $rt_file->content_length == 0) { return 0; } --- 163,180 ---- } ! # Check whether data files on the RT website are empty but still online, or ! # contain HTML/XML from the Radio Times' error page. ! # # These files will have a good HTTP response header as they exist, but they # contain no data. Caching via HCT without checking for a non-zero content_size # beforehand will therefore overwrite good data with bad. Any file having a ! # content_length of 0 or seen to contain HTML will not be cached and the ! # existing cached copy of the file will be used. This relies on using a ! # HTTP::Cache::Transparent release > 0.7. # sub check_content_length { my $rt_file = shift @_; if( $rt_file->is_success ) { ! if( $rt_file->content_length == 0 || $rt_file->content =~ /DOCTYPE/ ) { return 0; } |