From b9de90c485d8829b6fd690de0cf7d32de75769a5 Mon Sep 17 00:00:00 2001 From: Tom Najdek Date: Fri, 5 Apr 2024 12:57:10 +0200 Subject: [PATCH] Mendeley importer: Sniff for mime-type if `octet-stream` reported. #3454 --- chrome/content/zotero/import/mendeley/mendeleyImport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/import/mendeley/mendeleyImport.js b/chrome/content/zotero/import/mendeley/mendeleyImport.js index 9d6613e2e6..669b4c23a4 100644 --- a/chrome/content/zotero/import/mendeley/mendeleyImport.js +++ b/chrome/content/zotero/import/mendeley/mendeleyImport.js @@ -1627,7 +1627,7 @@ Zotero_Import_Mendeley.prototype._saveAnnotations = async function (annotations, if (file) { // Fix blank PDF attachment MIME type from previous imports let type = 'application/pdf'; - if (!attachmentItem.attachmentContentType) { + if (!attachmentItem.attachmentContentType || attachmentItem.attachmentContentType === 'application/octet-stream') { if (Zotero.MIME.sniffForMIMEType(await Zotero.File.getSample(file)) == type) { attachmentItem.attachmentContentType = type; await attachmentItem.saveTx(this._saveOptions);