www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit c04b85e74648f9f58dbc100faf1c4eaaa816228e
parent c89df69f142375a0941928e775f2536733a29ce0
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sun, 11 Mar 2018 18:15:51 -0400

Use all DOI translators for metadata retrieval

The old recognizer code only used CrossRef, and the new code copied
that, but I think the old code simply predated additional DOI
translators and was never updated.

Diffstat:
Mchrome/content/zotero/xpcom/recognizePDF.js | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/chrome/content/zotero/xpcom/recognizePDF.js b/chrome/content/zotero/xpcom/recognizePDF.js @@ -541,11 +541,15 @@ Zotero.RecognizePDF = new function () { if (res.doi) { Zotero.debug('RecognizePDF: Getting metadata by DOI'); - let translateDOI = new Zotero.Translate.Search(); - translateDOI.setTranslator('11645bd1-0420-45c1-badb-53fb41eeb753'); - translateDOI.setSearch({'itemType': 'journalArticle', 'DOI': res.doi}); + let translate = new Zotero.Translate.Search(); + translate.setIdentifier({ + DOI: res.doi + }); + let translators = await translate.getTranslators(); + translate.setTranslator(translators); + try { - let newItem = await _promiseTranslate(translateDOI, libraryID); + let newItem = await _promiseTranslate(translate, libraryID); if (!newItem.abstractNote && res.abstract) { newItem.setField('abstractNote', res.abstract); }