Skip to content

Commit f356c9d

Browse files
committed
Fix case sensitive DOI references
1 parent 0bd3096 commit f356c9d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

refman/refman.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ def _paper_paths_list(self):
258258

259259
def _get_paper_meta(self, paper) -> dict:
260260
return {
261-
"doi": paper.meta.get("doi", None), # For parsing via DOI
262-
"eprint": paper.meta.get("eprint", None), # For parsing via arxiv
261+
"doi": paper.meta.get("doi", ""), # For parsing via DOI
262+
"eprint": paper.meta.get("eprint", ""), # For parsing via arxiv
263263
"bibtex_path": str(paper.bibtex_path),
264264
"bibtex_key": str(paper._bibtex_key),
265265
}
@@ -274,7 +274,13 @@ def add_using_arxiv(self, arxiv: str):
274274
self._update_db()
275275

276276
def add_using_doi(self, doi: str, pdf: str):
277-
if doi is not None and doi not in list(self.db.get("doi", list())):
277+
if (
278+
doi is not None and
279+
doi.lower() not in map(
280+
lambda x: x.lower(),
281+
self.db.get("doi", list())
282+
)
283+
):
278284
self.append_to_db(Paper.new_paper_from_doi(doi, pdf))
279285

280286
self._update_db()

0 commit comments

Comments
 (0)