--- a/tv_grab_zz_sdjson +++ b/tv_grab_zz_sdjson @@ -235,7 +235,7 @@ # minimize the chance of an error causing the day to be off by one. sub parse_original_airdate { my ($year, $month, $day) = ($_[0] =~ /(\d+)-(\d+)-(\d+)/); - local $Params::Validate::NO_VALIDATION = 1; +# local $Params::Validate::NO_VALIDATION = 1; return DateTime->new( year => $year, month => $month, @@ -1339,9 +1339,14 @@ # The xmltv docs state this field is "When and where the programme was last shown". # However mythtv expects the original air date to be in this field. sub get_program_previously_shown { - my ($details) = @_; + my ($program, $details) = @_; my %previously_shown; + my $new = $program->{'new'}; + if($new) { + return undef; + } + my $date = $details->{'originalAirDate'}; if($date) { my $dt = parse_original_airdate($date); @@ -1457,7 +1462,7 @@ 'episode-num' => get_program_episode($program, $details), 'video' => get_program_video($program), 'audio' => get_program_audio($program), - 'previously-shown' => get_program_previously_shown($details), + 'previously-shown' => get_program_previously_shown($program, $details), 'premiere' => get_program_premiere($program), # 'last-chance' => undef, 'new' => get_program_new($program),