diff options
Diffstat (limited to 'rhautoimport-btl')
-rwxr-xr-x | rhautoimport-btl | 11 |
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"); |