commit 67b34b14824ca18a3e39543f723b85382d332ccc parent a67395678730d402f40e37441916aa6d1daf4a08 Author: Dan Stillman <dstillman@zotero.org> Date: Wed, 21 Mar 2018 12:58:20 -0700 Create automatic (not manual) tags when retrieving PDF metadata by ISBN https://forums.zotero.org/discussion/71003/metadata-problem Diffstat:
| M | chrome/content/zotero/xpcom/recognizePDF.js | | | 13 | +++++++++++++ |
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/recognizePDF.js b/chrome/content/zotero/xpcom/recognizePDF.js @@ -577,6 +577,19 @@ Zotero.RecognizePDF = new function () { Zotero.debug(translatedItems); if (translatedItems.length) { let newItem = new Zotero.Item; + // Convert tags to automatic. For other items this is done automatically in + // translate.js for other items, but for ISBNs we just get the data + // (libraryID=false) and do the saving manually. + translatedItems[0].tags = translatedItems[0].tags.map(tag => { + if (typeof tag == 'string') { + return { + tag, + type: 1 + }; + } + tag.type = 1; + return tag; + }); newItem.fromJSON(translatedItems[0]); newItem.libraryID = libraryID; if (!newItem.abstractNote && res.abstract) {