diff options
author | Christian Pointner <equinox@helsinki.at> | 2024-02-07 19:40:10 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2024-02-07 19:40:10 (GMT) |
commit | 28ebf38833ffd89508a969eedb1df307eed5675e (patch) | |
tree | de64e4dd492646d56ff37aea1aea10bc53195af2 /rhautoimport-mc | |
parent | 192c08b70372d6b54ad9e130f3195b092f2fb40c (diff) |
update importer for music circus hip hop show
Diffstat (limited to 'rhautoimport-mc')
-rwxr-xr-x | rhautoimport-mc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/rhautoimport-mc b/rhautoimport-mc index d3a3d43..d0c977e 100755 --- a/rhautoimport-mc +++ b/rhautoimport-mc @@ -65,17 +65,26 @@ my @today = Date::Calc::Today(); print "today: " . Date::Calc::Date_to_Text(@today) . " (Week: " . $curweek . ")\n"; my @import_date = Date::Calc::Standard_to_Business(@today); -$import_date[2] = 1; +$import_date[2] = 6; @import_date = Date::Calc::Business_to_Standard(@import_date); my $dow = Date::Calc::Day_of_Week(@today); -if($curweek == 2 || $curweek == 4) { +if($curweek == 1 || $curweek == 3) { @import_date = Date::Calc::Add_Delta_Days(@import_date, 7); } else { - @import_date = Date::Calc::Add_Delta_Days(@import_date, 14); + if($dow > 6) { + @import_date = Date::Calc::Add_Delta_Days(@import_date, 14); + } } print "day of next Radio Helsinki broadcast: " . Date::Calc::Date_to_Text(@import_date) . "\n"; +my @broadcast_date = @import_date; +print "day of latest original broadcast before next Radio Helsinki broadcast: " . Date::Calc::Date_to_Text(@broadcast_date) . "\n"; + +if(Date::Calc::Delta_Days(@broadcast_date, @today) < $upload_delay_days) { + print "File won't be available by now!\n"; + exit 42; +} my @allowed_dbs = rhautoimport::get_dropboxes($RD_GROUP); if(!defined $allowed_dbs[0] && defined $allowed_dbs[1]) { @@ -90,13 +99,6 @@ if(scalar(@allowed_dbs) != 1) { my $show_id = $allowed_dbs[0]->{'SHOWID'}; my $show_title = $allowed_dbs[0]->{'SHOWTITLE'}; -my @broadcast_date = Date::Calc::Add_Delta_Days(@import_date, -9); -print "day of latest original broadcast before next Radio Helsinki broadcast: " . Date::Calc::Date_to_Text(@broadcast_date) . "\n"; - -if(Date::Calc::Delta_Days(@broadcast_date, @today) <= $upload_delay_days) { - print "File won't be available by now!\n"; - exit 42; -} my $id = sprintf("%04d-%02d-%02d", @import_date); my $bd = sprintf("%04d-%02d-%02d", @broadcast_date); |