Project

General

Profile

tv_grab_zz_sdjson patches » tv_grab_zz_sdjson.patch

Robert Cameron, 2017-08-20 07:55

View differences:

tv_grab_zz_sdjson
235 235
# minimize the chance of an error causing the day to be off by one.
236 236
sub parse_original_airdate {
237 237
	my ($year, $month, $day) = ($_[0] =~ /(\d+)-(\d+)-(\d+)/);
238
	local $Params::Validate::NO_VALIDATION = 1;
238
#	local $Params::Validate::NO_VALIDATION = 1;
239 239
	return DateTime->new(
240 240
		year       => $year,
241 241
		month      => $month,
......
1339 1339
# The xmltv docs state this field is "When and where the programme was last shown".
1340 1340
# However mythtv expects the original air date to be in this field.
1341 1341
sub get_program_previously_shown {
1342
	my ($details) = @_;
1342
	my ($program, $details) = @_;
1343 1343
	my %previously_shown;
1344 1344

  
1345
    my $new = $program->{'new'};
1346
    if($new) {
1347
        return undef;
1348
    }
1349

  
1345 1350
	my $date = $details->{'originalAirDate'};
1346 1351
	if($date) {
1347 1352
		my $dt = parse_original_airdate($date);
......
1457 1462
			'episode-num'      => get_program_episode($program, $details),
1458 1463
			'video'            => get_program_video($program),
1459 1464
			'audio'            => get_program_audio($program),
1460
			'previously-shown' => get_program_previously_shown($details),
1465
			'previously-shown' => get_program_previously_shown($program, $details),
1461 1466
			'premiere'         => get_program_premiere($program),
1462 1467
#			'last-chance'      => undef,
1463 1468
			'new'              => get_program_new($program),
(1-1/2)