diff --git a/jendeley-backend/src/api.test.ts b/jendeley-backend/src/api.test.ts index 7474e01..a1b752e 100644 --- a/jendeley-backend/src/api.test.ts +++ b/jendeley-backend/src/api.test.ts @@ -3,7 +3,7 @@ import { genRight } from "./either"; test("title from nodejs", async () => { const title = await getTitleFromUrl("https://nodejs.org/en/"); - expect(title).toStrictEqual(genRight("Node.js")); + expect(title).toStrictEqual(genRight("Node.js — Run JavaScript Everywhere")); }); test("title from python", async () => { diff --git a/jendeley-backend/src/docid.ts b/jendeley-backend/src/docid.ts index a80fe2b..550e216 100644 --- a/jendeley-backend/src/docid.ts +++ b/jendeley-backend/src/docid.ts @@ -326,7 +326,8 @@ async function getTitleFromPDF( data["meta"] != undefined && data["meta"]["metadata"] != undefined && data["meta"]["metadata"]["dc:title"] != undefined && - data["meta"]["metadata"]["dc:title"] != "" + data["meta"]["metadata"]["dc:title"] != "" && + data["meta"]["metadata"]["dc:title"] != "untitled" ) { const title = data["meta"]["metadata"]["dc:title"]; logger.info("getTitleFromPDF(" + pdf + ", " + papersDir + ") = " + title); @@ -337,7 +338,8 @@ async function getTitleFromPDF( data["meta"] != undefined && data["meta"]["info"] != undefined && data["meta"]["info"]["Title"] != undefined && - data["meta"]["info"]["Title"] != "" + data["meta"]["info"]["Title"] != "" && + data["meta"]["info"]["Title"] != "untitled" ) { const title = data["meta"]["info"]["Title"]; logger.info("getTitleFromPDF(" + pdf + ", " + papersDir + ") = " + title);