diff options
author | Christian Pointner <equinox@helsinki.at> | 2018-11-21 13:54:54 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2018-11-21 13:54:54 (GMT) |
commit | a827cfc59789b88d1474ee9dc83b4b410f3b4bb8 (patch) | |
tree | ea6e5ba30d10e251586727636294b9e8fb74ca07 | |
parent | 36fc438075c73ecadfce7de6305660aedf9331c9 (diff) |
fix literadio importer
-rwxr-xr-x | rhautoimport-lr | 9 |
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`; |