Follow automatic tags prefs when retrieving PDF metadata by ISBN
https://forums.zotero.org/discussion/85777/retrieve-metadata-for-pdf-creates-automatic-tags-even-when-pref-is-off
This commit is contained in:
parent
38b997bee9
commit
2e2a4bca7f
1 changed files with 17 additions and 12 deletions
|
@ -504,8 +504,9 @@ Zotero.RecognizePDF = new function () {
|
||||||
let newItem = new Zotero.Item;
|
let newItem = new Zotero.Item;
|
||||||
newItem.libraryID = libraryID;
|
newItem.libraryID = libraryID;
|
||||||
// Convert tags to automatic. For other items this is done automatically in
|
// 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
|
// translate.js, but for ISBNs we just get the data (libraryID=false) and do the
|
||||||
// (libraryID=false) and do the saving manually.
|
// saving manually.
|
||||||
|
if (Zotero.Prefs.get('automaticTags')) {
|
||||||
translatedItems[0].tags = translatedItems[0].tags.map(tag => {
|
translatedItems[0].tags = translatedItems[0].tags.map(tag => {
|
||||||
if (typeof tag == 'string') {
|
if (typeof tag == 'string') {
|
||||||
return {
|
return {
|
||||||
|
@ -516,6 +517,10 @@ Zotero.RecognizePDF = new function () {
|
||||||
tag.type = 1;
|
tag.type = 1;
|
||||||
return tag;
|
return tag;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translatedItems[0].tags = [];
|
||||||
|
}
|
||||||
newItem.fromJSON(translatedItems[0]);
|
newItem.fromJSON(translatedItems[0]);
|
||||||
if (!newItem.abstractNote && res.abstract) {
|
if (!newItem.abstractNote && res.abstract) {
|
||||||
newItem.setField('abstractNote', res.abstract);
|
newItem.setField('abstractNote', res.abstract);
|
||||||
|
|
Loading…
Reference in a new issue