if ($options->{search_by_pmid}) {
$entry = select_entry_from_pmid($dbh,$sth,$bibtex_key);
} else {
- select_entry_from_bibtex_key($dbh,$sth,$bibtex_key);
+ $entry = select_entry_from_bibtex_key($dbh,$sth,$bibtex_key);
}
p $entry if $DEBUG;
open_entry($dbh,$sth,$entry,$options);
my ($dbh,$sth,$entry,$options) = @_;
return unless defined $entry and ref $entry and keys %{$entry};
+ if ($DEBUG) {
+ print STDERR "Entry: \n";
+ p $entry;
+ }
if (defined $entry->{file_name} and length $entry->{file_name}) {
my $paper = select_one($dbh,$sth->{select_papers_by_name},$entry->{file_name});
if (not defined $paper) {
}
open_pdf($paper->{path},$options,$paper->{has_xoj});
return;
+ } else {
+ print STDERR "Unable to find paper\n" if $DEBUG;
}
}
if (defined $entry->{doi}) {
my $entry = select_one($dbh,$sth->{select_bibtex_by_key},$bibtex_key);
if (not defined $entry) {
+ print STDERR "Unable to find entry by exact search\n" if $DEBUG;
$bibtex_key =~ s/:.*$//;
$entry = select_one($dbh,$sth->{select_bibtex_by_approximate_key},$bibtex_key.'%');
}
+ print STDERR "Found entry\n" if $DEBUG and defined $entry;
return $entry;
}