diff options
-rw-r--r-- | INFO | 2 | ||||
-rwxr-xr-x | rhautoimport-mc | 22 |
2 files changed, 13 insertions, 11 deletions
@@ -103,7 +103,7 @@ Original: "jeder gerade Samstag" 19-21 Uhr Upload: meistens am selben tag Such-Kriterium: cba:broadcastDate wenn gesetzt sonst cba:productionDate - RH: 2wöchentlich, Woche 1/3, Montag 00:00-02:00 + RH: 2wöchentlich, Woche 2/4, Montag 00:00-02:00 - (sol) SOL on Air https://cba.media/podcast/sol-on-air/feed 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); |