| | 574 | |
| | 575 | $abc2_eariest_start = $show->{'start'} |
| | 576 | if ($channel eq "ABC2" && $abc2_eariest_start > $show->{'start'}); |
| | 577 | } |
| | 578 | } |
| | 579 | |
| | 580 | # check if abc2 has a gap on the first day when the station is closed |
| | 581 | if (defined $channels->{ABC2} && |
| | 582 | $abc2_eariest_start > POSIX::strftime("%Y%m%d%H%M", localtime($starttime))) { |
| | 583 | |
| | 584 | # create 7am today |
| | 585 | my @timeattr = localtime($script_start_time); # 0=sec,1=min,2=hour,3=day,4=month,5=year,6=wday,7=yday,8=isdst |
| | 586 | $timeattr[0] = 0; # zero seconds |
| | 587 | $timeattr[1] = 0; # min |
| | 588 | $timeattr[2] = 7; # hours 7am |
| | 589 | my $time7am = mktime(@timeattr); |
| | 590 | $time7am -= $time_offset; |
| | 591 | my $xmltime7am = POSIX::strftime("%Y%m%d%H%M", localtime($time7am)); |
| | 592 | |
| | 593 | if (($starttime < $time7am) && ($abc2_eariest_start >= $xmltime7am)) |
| | 594 | { |
| | 595 | my $show; |
| | 596 | $show->{'channel'} = $channels->{ABC2}; |
| | 597 | $show->{'title'} = [[ "Station Close Guess", $opt->{lang} ]]; |
| | 598 | $show->{'start'} = POSIX::strftime("%Y%m%d%H%M", localtime($starttime)); |
| | 599 | $show->{'stop'} = $abc2_eariest_start; |
| | 600 | |
| | 601 | Shepherd::Common::cleanup($show); |
| | 602 | $writer->write_programme($show); |