Skip to content

Commit 27612d7

Browse files
committed
Use DOI to identify same papers
1 parent 0d3f514 commit 27612d7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/data-search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ export async function getData () {
4545
// Filter for multiple versions of the same paper
4646
const papers = [];
4747
for (const paper of allPapers) {
48-
const exists = papers.find((obj) => obj.title === paper.title);
48+
const exists = papers.find((obj) => obj.doi === paper.doi);
4949

5050
if (!exists) {
51-
const allVersions = allPapers.filter((obj) => obj.title === paper.title);
51+
const allVersions = allPapers.filter((obj) => obj.doi === paper.doi);
5252
if (allVersions.length > 1) {
5353
const max = allVersions.reduce((maxObj, obj) => {
5454
if (obj.version > maxObj.version) {

0 commit comments

Comments
 (0)