summaryrefslogtreecommitdiff
path: root/rhautoimport-lr
diff options
context:
space:
mode:
Diffstat (limited to 'rhautoimport-lr')
-rwxr-xr-xrhautoimport-lr9
1 files changed, 8 insertions, 1 deletions
diff --git a/rhautoimport-lr b/rhautoimport-lr
index 1b188a2..55998b7 100755
--- a/rhautoimport-lr
+++ b/rhautoimport-lr
@@ -88,7 +88,14 @@ if($curweek == 2 && $today[2] >= 4) {
my @import_date_reb = Date::Calc::Add_Delta_Days(@import_date, 22);
print "day of Radio Helsinki broadcast: " . Date::Calc::Date_to_Text(@import_date) . "\n";
-print "day of Radio Helsinki rebroadcast: " . Date::Calc::Date_to_Text(@import_date_reb) . "\n";
+print "day of this show's rebroadcast: " . Date::Calc::Date_to_Text(@import_date_reb) . "\n";
+
+my @reb_date_last = Date::Calc::Add_Delta_Days(@import_date_reb, -28);
+print "day of last show's rebroadcast: " . Date::Calc::Date_to_Text(@reb_date_last) . "\n";
+if(Date::Calc::Delta_Days(@today, @reb_date_last) >= 0) {
+ print "the rebroadcast from last show has not been played yet!\n";
+ exit 42;
+}
my $id = sprintf("%04d-%02d-%02d", @import_date);
my $current_stat = `cat $STAT_FILE`;