From 26dcaad76aa83bed541658b7ecf44a17adff5447 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 1 Mar 2018 00:07:38 -0500 Subject: [PATCH] Don't show Reindex button for files that aren't PDFs or text files --- chrome/content/zotero/xpcom/fulltext.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js index ce3df35726..b51ca3238a 100644 --- a/chrome/content/zotero/xpcom/fulltext.js +++ b/chrome/content/zotero/xpcom/fulltext.js @@ -1347,7 +1347,12 @@ Zotero.Fulltext = Zotero.FullText = new function(){ * Item must be a non-web-link attachment that isn't already fully indexed */ this.canReindex = Zotero.Promise.coroutine(function* (item) { - if (item.isAttachment() && item.attachmentLinkMode != Zotero.Attachments.LINK_MODE_LINKED_URL) { + if (item.isAttachment() + && item.attachmentLinkMode != Zotero.Attachments.LINK_MODE_LINKED_URL) { + let contentType = item.attachmentContentType; + if (!contentType || contentType != 'application/pdf' && !Zotero.MIME.isTextType(contentType)) { + return false; + } switch (yield this.getIndexedState(item)) { case this.INDEX_STATE_UNAVAILABLE: case this.INDEX_STATE_UNINDEXED: