summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-03-12 04:04:21 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-03-12 04:04:21 (GMT)
commit1c8656a1e6e8de207268b66f8e7f91118be29075 (patch)
treeff5b8b8efa275dfd6d238d3b8bdbc9f7db343509
parente7d0a121c523387f0f59bce592a97ebfb13a90f8 (diff)
some more cleanup for btl importer
-rwxr-xr-xrhautoimport-btl11
1 files changed, 5 insertions, 6 deletions
diff --git a/rhautoimport-btl b/rhautoimport-btl
index 54ef790..eb05594 100755
--- a/rhautoimport-btl
+++ b/rhautoimport-btl
@@ -87,24 +87,23 @@ 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/;
- my $sum_title = decode_entities($entry->title);
- $sum_title =~ s/ \(128 kbps\)$//;
- my $sum_text = decode_entities($entry->content->body);
-
$uri = new URI::URL($entry->enclosure->url);
my @path = $uri->path_components;
+ $file = $path[-1];
my $current_file = `cat $STAT_FILE`;
- if($current_file eq $path[-1]) {
+ if($current_file eq $file) {
print "Already downloaded file of today\n";
exit 0;
}
- $file = $path[-1];
if(!rhautoimport::check_file_extension($file)) {
print "\n\nThe extension of the matching file '". $file . "' seems to be wrong - manual import necessary!!!\n";
exit 1;
}
+ my $sum_title = decode_entities($entry->title);
+ $sum_title =~ s/ \(128 kbps\)$//;
+ my $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");