diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-03-12 22:50:05 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-03-12 22:50:05 (GMT) |
commit | 593cb6b5edc8adfe2bbf290ba594f9260c0cf350 (patch) | |
tree | eb50c738ff6571cf9545c4d8910a95b71ce3a00a | |
parent | bbc151dcd8d88f543454cb282e1dac01ef720894 (diff) |
btl is now tested as well - note will only be set when import was successful
-rwxr-xr-x | rhautoimport-btl | 15 | ||||
-rwxr-xr-x | rhautoimport-ra | 4 |
2 files changed, 12 insertions, 7 deletions
diff --git a/rhautoimport-btl b/rhautoimport-btl index eb05594..38d3090 100755 --- a/rhautoimport-btl +++ b/rhautoimport-btl @@ -83,6 +83,9 @@ my $feed = rhautoimport::fetch_parse_rss($RSS_URL) my $uri = ""; my $file = ""; +my $sum_title = ""; +my $sum_text = ""; + for my $entry ($feed->entries) { if($entry->enclosure && ($entry->enclosure->type eq "audio/mpeg" || entry->enclosure->type eq "audio/mp3")) { next unless $entry->enclosure->url =~ /$bdfile/; @@ -101,17 +104,15 @@ for my $entry ($feed->entries) { exit 1; } - my $sum_title = decode_entities($entry->title); + $sum_title = decode_entities($entry->title); $sum_title =~ s/ \(128 kbps\)$//; - my $sum_text = decode_entities($entry->content->body); + $sum_text = decode_entities($entry->content->body); print "summary:\n" . $sum_title . "\n\n" . $sum_text . "\n"; - rhautoimport::pv_add_note($sum_title, $sum_text, $PV_ID, $id, "1"); - last; } } if($uri eq "") { - print "No Entry found for " . Date::Calc::Date_to_Text(@broadcast_date) . " or download error - "; + print "No Entry found for " . Date::Calc::Date_to_Text(@broadcast_date) . " - "; if($#ARGV >= 0 && $ARGV[0] eq 'last') { print "giving up, manual import necessary!!!\n"; } else { @@ -120,16 +121,18 @@ if($uri eq "") { exit 1; } -print "will import '$uri' to show $show_id, $show_title\n\n"; +print "\n\nwill import '$uri' to show $show_id, $show_title\n\n"; my ($ret, $log) = rhautoimport::import_uri($show_id, $uri->as_string); if($ret) { print "\nImport Error:\n\n"; print $log; + print "\n\nNot adding PV note!!"; exit 1; } print "\nImport Success:\n\n"; print $log; +rhautoimport::pv_add_note($sum_title, $sum_text, $PV_ID, $id, "1"); unlink($STAT_FILE); open(my $fhs, '>', $STAT_FILE); diff --git a/rhautoimport-ra b/rhautoimport-ra index 3cf2843..d75d18e 100755 --- a/rhautoimport-ra +++ b/rhautoimport-ra @@ -136,7 +136,7 @@ if($uri eq "") { exit 1; } -print "will import '$uri' to show $show_id, $show_title\n"; +print "\n\nwill import '$uri' to show $show_id, $show_title\n"; my ($ret, $log, $keptfile_uri) = rhautoimport::import_uri($show_id, $uri->as_string, "keep"); if($ret == 0) { print "\nImport Success:\n\n"; @@ -159,11 +159,13 @@ if($ret == 0) { } else { print "\nImport Error:\n\n"; print $log; + print "\n\nNot adding PV note!!"; exit 1; } } else { print "\nImport Error:\n\n"; print $log; + print "\n\nNot adding PV note!!"; exit 1; } |