Skip to content

Commit

Permalink
Fix case sensitive DOI references
Browse files Browse the repository at this point in the history
  • Loading branch information
adriancaruana committed May 3, 2021
1 parent 0bd3096 commit f356c9d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions refman/refman.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ def _paper_paths_list(self):

def _get_paper_meta(self, paper) -> dict:
return {
"doi": paper.meta.get("doi", None), # For parsing via DOI
"eprint": paper.meta.get("eprint", None), # For parsing via arxiv
"doi": paper.meta.get("doi", ""), # For parsing via DOI
"eprint": paper.meta.get("eprint", ""), # For parsing via arxiv
"bibtex_path": str(paper.bibtex_path),
"bibtex_key": str(paper._bibtex_key),
}
Expand All @@ -274,7 +274,13 @@ def add_using_arxiv(self, arxiv: str):
self._update_db()

def add_using_doi(self, doi: str, pdf: str):
if doi is not None and doi not in list(self.db.get("doi", list())):
if (
doi is not None and
doi.lower() not in map(
lambda x: x.lower(),
self.db.get("doi", list())
)
):
self.append_to_db(Paper.new_paper_from_doi(doi, pdf))

self._update_db()
Expand Down

0 comments on commit f356c9d

Please sign in to comment.