xmltv/grab/sd_json tv_grab_sd_json,1.12,1.13
Kevin Groeneveld <[email protected]> Fri, 01 Jul 2016 17:08:52 +0000
| Newsgroups | gmane.comp.tv.xmltv.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/xmltv/xmltv/grab/sd_json
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1343
Modified Files:
tv_grab_sd_json
Log Message:
tv_grab_sd_json: Output complete days instead of 24 hour windows.
This commit also fixes some DST issues as a complete day is sometimes 23
or 25 hours. I also removed the +/-15 minute fudge factor on the 24 hour
window which serves no purpose when always using complete days.
Programs which start exactly at the end boundary or end exactly at the
start boundary are also no longer included. If you run the grabber for
adjacent days there should no longer be duplicates unless the program
actually spans both days.
Index: tv_grab_sd_json
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/sd_json/tv_grab_sd_json,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** tv_grab_sd_json 11 Jun 2016 17:53:34 -0000 1.12
--- tv_grab_sd_json 1 Jul 2016 17:08:50 -0000 1.13
***************
*** 168,182 ****
# calculate start and stop time from offset and days options
! my $dt_start = DateTime->now();
! my $today = $dt_start->strftime('%Y-%m-%d');
$dt_start->add(days => $opt->{'offset'});
my $dt_stop = $dt_start->clone();
$dt_stop->add(days => $opt->{'days'});
! # Add a little margin. Without this it would be more likely for some programs
! # to not be included at all when the grabber is only run in multiple segments
! # and the start time of the grabber is close to a program boundary.
! $dt_start->add(minutes => -15);
! $dt_stop->add(minutes => 15);
my $cache_file = $conf->{'cache'}->[0];
--- 168,179 ----
# calculate start and stop time from offset and days options
! my $dt_start = DateTime->today(time_zone => 'local');
$dt_start->add(days => $opt->{'offset'});
my $dt_stop = $dt_start->clone();
$dt_stop->add(days => $opt->{'days'});
! # source data has times in UTC
! $dt_start->set_time_zone('UTC');
! $dt_stop->set_time_zone('UTC');
my $cache_file = $conf->{'cache'}->[0];
***************
*** 729,733 ****
my $dur = DateTime::Duration->new(seconds => $program->{'duration'});
! if(($dt + $dur) >= $dt_start && $dt <= $dt_stop) {
my $id = $program->{'programID'};
my $cached = $cache_programs->{$id};
--- 726,730 ----
my $dur = DateTime::Duration->new(seconds => $program->{'duration'});
! if(($dt + $dur) > $dt_start && $dt < $dt_stop) {
my $id = $program->{'programID'};
my $cached = $cache_programs->{$id};
***************
*** 779,782 ****
--- 776,780 ----
elsif($key eq 'schedules') {
# remove old schedules
+ my $today = DateTime->today()->strftime('%Y-%m-%d');
while(my ($channel, $schedules) = each %{$hash}) {
if(ref $schedules ne 'HASH') {
***************
*** 1323,1327 ****
my $dur = DateTime::Duration->new(seconds => $program->{'duration'});
! if(($dt + $dur) >= $dt_start && $dt <= $dt_stop) {
my $start = $dt->strftime('%Y%m%d%H%M%S %z');
$dt->add_duration($dur);
--- 1321,1325 ----
my $dur = DateTime::Duration->new(seconds => $program->{'duration'});
! if(($dt + $dur) > $dt_start && $dt < $dt_stop) {
my $start = $dt->strftime('%Y%m%d%H%M%S %z');
$dt->add_duration($dur);
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape