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.
This commit is contained in:
Dan Stillman 2018-03-11 18:15:51 -04:00
parent c89df69f14
commit c04b85e746

View file

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