diff options
author | Christian Pointner <equinox@helsinki.at> | 2014-01-03 19:32:23 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2014-01-03 19:32:23 (GMT) |
commit | 0fa23c72acf69795a6c06aea16ca2aa01b88fa00 (patch) | |
tree | b0c08476f70db8202506d532608f1e4dc4f5e8ef /rhimport-zf | |
parent | 2ed0fc1ba24df52b44f97c5159e13ac96b5bf13f (diff) |
fixed zip-fm (with rebroadcast - next day)
Diffstat (limited to 'rhimport-zf')
-rwxr-xr-x | rhimport-zf | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/rhimport-zf b/rhimport-zf index 91bb4a0..963ef7e 100755 --- a/rhimport-zf +++ b/rhimport-zf @@ -71,15 +71,12 @@ my $to_cart_reb = 0; my @today = Date::Calc::Today(); my $dow = Date::Calc::Day_of_Week(@today); -my @tomorrow = Date::Calc::Add_Delta_Days($today[0], $today[1], $today[2], 1); - -my @tmp = Date::Calc::Standard_to_Business(@today); -$tmp[2] = 1; -my @this_mon = Date::Calc::Business_to_Standard(@tmp); -my @next_mon = Date::Calc::Add_Delta_Days($this_mon[0], $this_mon[1], $this_mon[2], 7); +my @tomorrow = Date::Calc::Add_Delta_Days(@today, 1); my @broadcast_day = @today; +my @rebroadcast_day = @tomorrow; print "day of broadcast: " . Date::Calc::Date_to_Text(@broadcast_day) . "\n"; +print "day of rebroadcast: " . Date::Calc::Date_to_Text(@rebroadcast_day) . "\n" unless $dow == 5; for my $href ( @allowed_dbs ) { if ($dow == int(substr($href->{'NAME'},0,2))) { @@ -126,10 +123,11 @@ for my $entry ($feed->entries) { print "summary:\n" . $sum_title . "\n\n" . $sum_text . "\n"; if($#ARGV >= 0 && $ARGV[0] eq 'nopv') { - print "not adding note to PV\n"; + print "not adding note to PV for regular entry - only for rebroadcast\n"; } else { - rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", $broadcast_day[0], $broadcast_day[1], $broadcast_day[2]), "1"); + rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", @broadcast_day), "1"); } + rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", @rebroadcast_day), "2") unless $dow == 5; print "\n"; unlink($NOTE_FILE); |