61 |
my $filter; |
my $filter; |
62 |
foreach my $f (qw/pdftotext pstotext/) { |
foreach my $f (qw/pdftotext pstotext/) { |
63 |
my $w = which($f); |
my $w = which($f); |
64 |
if ($f) { |
if ($w) { |
65 |
$filter->{$f} = $w; |
$filter->{$f} = $w; |
66 |
print STDERR "using $f filter at $w\n" if ($verbose); |
print STDERR "using $f filter at $w\n" if ($verbose); |
67 |
} |
} |
237 |
|
|
238 |
if ($contents) { |
if ($contents) { |
239 |
# html2text |
# html2text |
240 |
|
$contents =~ s#<script.*?</script>##gis; |
241 |
$contents =~ s#<[^>]+/*>##gs; |
$contents =~ s#<[^>]+/*>##gs; |
242 |
$contents =~ s#\s\s+# #gs; |
$contents =~ s#\s\s+# #gs; |
243 |
|
|
310 |
return if (! $all && -d $path); |
return if (! $all && -d $path); |
311 |
|
|
312 |
my $mtime = (stat($path))[9] || -1; |
my $mtime = (stat($path))[9] || -1; |
313 |
my $mtime_db = eval { $db->get_doc_attr_by_uri("file:///$path", '@mtime') }; |
my $mtime_db; |
314 |
|
eval { $db->get_doc_attr_by_uri("file:///$path", '@mtime') } unless ($force); |
315 |
$mtime_db ||= -2; |
$mtime_db ||= -2; |
316 |
|
|
317 |
if ($mtime == $mtime_db) { |
if ($mtime == $mtime_db) { |