summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrhimport-zf24
1 files changed, 18 insertions, 6 deletions
diff --git a/rhimport-zf b/rhimport-zf
index 59e9de3..13419e2 100755
--- a/rhimport-zf
+++ b/rhimport-zf
@@ -63,6 +63,8 @@ my @allowed_dbs = rhimport::get_dropboxes($dbh, $user, $group);
my $dropbox = "";
my $to_cart = 0;
+my $dropbox_reb = "";
+my $to_cart_reb = 0;
my @today = Date::Calc::Today();
my $dow = Date::Calc::Day_of_Week(@today);
@@ -76,18 +78,18 @@ my @next_mon = Date::Calc::Add_Delta_Days($this_mon[0], $this_mon[1], $this_mon[
my @broadcast_day = @today;
my @rebroadcast_day = @tomorrow;
if($dow == 5) {
- my @rebroadcast_day = @next_mon;
+ @rebroadcast_day = @next_mon;
}
print "day of broadcast: " . Date::Calc::Date_to_Text(@broadcast_day) . "\n";
-print "day of rebroadcast: " . Date::Calc::Date_to_Text(@rebroadcast_day) . "\n";
-
-#### until here...
+# TODO: REBROADCAST
+#print "day of rebroadcast: " . Date::Calc::Date_to_Text(@rebroadcast_day) . "\n";
for my $href ( @allowed_dbs ) {
if ($dow == int(substr($href->{'NAME'},0,2))) {
$dropbox = $href->{'PATH'};
$to_cart = $href->{'TO_CART'};
+## TODO: get right cart for rebroadcast
}
}
@@ -128,8 +130,11 @@ for my $entry ($feed->entries) {
print "summary:\n" . $sum_title . "\n\n" . $sum_text . "\n";
- rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", $import_day[0], $import_day[1], $import_day[2]), "1");
- print "\n";
+ rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", $broadcast_day[0], $broadcast_day[1], $broadcast_day[2]), "1");
+ print "\n";
+# TODO: REBROADCAST
+# rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", $rebroadcast_day[0], $rebroadcast_day[1], $rebbroadcast_day[2]), "2");
+# print "\n";
last;
}
@@ -145,6 +150,8 @@ if($file eq "" || !(-e "$file")) {
}
print "will import $file to dropbox $dropbox (cart=$to_cart)\n";
+# TODO: REBROADCAST
+#print "will import $file to rebroadcast dropbox $dropbox_reb (cart=$to_cart_reb)\n\n";
my $error_cb = sub {
my ($text) = @_;
@@ -160,6 +167,11 @@ my $log = rhimport::clear_carts($dbh, $group, $to_cart);
my $import_log;
($ret, $import_log) = rhimport::import_single($file, $dropbox, $user, 0, $error_cb);
$log .= $import_log;
+# TODO: REBROADCAST
+# $import_log = rhimport::clear_carts($dbh, $group, $to_cart_reb);
+# $log .= $import_log;
+# ($ret, $import_log) = rhimport::import_single($file, $dropbox_reb, $user, 0, $error_cb);
+# $log .= $import_log;
$dbh->disconnect();