diff options
-rw-r--r-- | debian/changelog | 6 | ||||
-rwxr-xr-x | rhimport-fw | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index 7916b50..1485023 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +rhimport (0.3.8-7) unstable; urgency=low + + * fixed rhimport-fw for mondays + + -- Christian Pointner <equinox@helsinki.at> Sun, 06 Jun 2012 15:16:12 +0100 + rhimport (0.3.8-6) unstable; urgency=low * added rhimport-fw diff --git a/rhimport-fw b/rhimport-fw index 32d8d99..d781b6c 100755 --- a/rhimport-fw +++ b/rhimport-fw @@ -60,13 +60,14 @@ my $dropbox = ""; my $to_cart = 0; my @today = Date::Calc::Today(); -my @yesterday = Date::Calc::Add_Delta_Days($today[0], $today[1], $today[2], -1); +my $dow = Date::Calc::Day_of_Week(@today); +my @broadcastday = Date::Calc::Add_Delta_Days($today[0], $today[1], $today[2], -1); +@broadcastday = Date::Calc::Add_Delta_Days($today[0], $today[1], $today[2], -3) if $dow == 1; print "today: " . Date::Calc::Date_to_Text(@today) . "\n"; -print "yesterday: " . Date::Calc::Date_to_Text(@yesterday) . "\n"; +print "day of original broadcast: " . Date::Calc::Date_to_Text(@broadcastday) . "\n"; for my $href ( @allowed_dbs ) { - my $dow = Date::Calc::Day_of_Week(@today); if ($dow == int(substr($href->{'NAME'},0,2))) { $dropbox = $href->{'PATH'}; $to_cart = $href->{'TO_CART'}; @@ -80,8 +81,8 @@ if($dropbox eq "") { } -my $regexp = sprintf("%04d%02d%02dfrontex\\.mp3\$", $yesterday[0], $yesterday[1], $yesterday[2]); -print "looking for file from " . Date::Calc::Date_to_Text(@yesterday) . " in RSS Feed\n"; +my $regexp = sprintf("%04d%02d%02dfrontex\\.mp3\$", $broadcastday[0], $broadcastday[1], $broadcastday[2]); +print "looking for file from " . Date::Calc::Date_to_Text(@broadcastday) . " in RSS Feed\n"; my $feed = XML::Feed->parse(URI->new($RSS_URL)) or die "Error fetching feed: " . XML::Feed->errstr; @@ -117,7 +118,7 @@ for my $entry ($feed->entries) { } } if($file eq "" || !(-e "$file")) { - print "No Entry found for " . Date::Calc::Date_to_Text(@yesterday) . " or download error - will retry later\n"; + print "No Entry found for " . Date::Calc::Date_to_Text(@broadcastday) . " or download error - will retry later\n"; exit 1; } |