From e34f35c083bbf377b08f0257e66c1391bfd306f5 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 31 May 2023 10:23:26 +0200 Subject: radio-attac has been moved to monday diff --git a/INFO b/INFO index d54dec6..89ce2d2 100644 --- a/INFO +++ b/INFO @@ -56,7 +56,7 @@ Original: wöchentlich Montags Upload: meistens am selben Tag, abends (> 20 Uhr) Such-Kriterium: cba:broadcastDate wenn gesetzt sonst cba:productionDate - RH: wöchentlich, Samstag, 15:30-16:00 + RH: wöchentlich, Montag, 13:30-14:00 - (ek) Eigenklang: https://cba.fro.at/series/eigenklang/feed diff --git a/rhautoimport-ra b/rhautoimport-ra index b72c5d7..6874e34 100755 --- a/rhautoimport-ra +++ b/rhautoimport-ra @@ -24,6 +24,7 @@ use strict; use Date::Calc; use DateTime::Format::Strptime; +use Time::localtime; use XML::Feed; use XML::Feed::Entry; use XML::Feed::Content; @@ -69,11 +70,15 @@ my $show_title = $allowed_dbs[0]->{'SHOWTITLE'}; my @today = Date::Calc::Today(); -my @tmp = Date::Calc::Standard_to_Business(@today); -$tmp[2] = 1; -my @broadcast_date = Date::Calc::Business_to_Standard(@tmp); -$tmp[2] = 6; -my @import_date = Date::Calc::Business_to_Standard(@tmp); +my $dow = Date::Calc::Day_of_Week(@today); +my @import_date = @today; +if($dow != 1 || localtime->hour >= 13) { + @import_date = Date::Calc::Standard_to_Business(@today); + $import_date[2] = 1; + @import_date = Date::Calc::Business_to_Standard(@import_date); + @import_date = Date::Calc::Add_Delta_Days(@import_date, 7); +} +my @broadcast_date = Date::Calc::Add_Delta_Days(@import_date, -7); print "today: " . Date::Calc::Date_to_Text(@today) . "\n"; print "day of original broadcast: " . Date::Calc::Date_to_Text(@broadcast_date) . "\n"; -- cgit v0.10.2