From 8f40296cb619b8a0706c349af9ce9f960a1a22f8 Mon Sep 17 00:00:00 2001 From: frianasoa Date: Tue, 29 Oct 2024 00:05:22 +0900 Subject: [PATCH] Fixing pdf error importing annotations --- core/nsync.js | 24 ++++++++++++++++++++---- install.rdf | 2 +- manifest.json | 2 +- zenote-update.json | 6 +++--- zenote-update.rdf | 6 +++--- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/core/nsync.js b/core/nsync.js index c60b7db..c798f7a 100644 --- a/core/nsync.js +++ b/core/nsync.js @@ -332,10 +332,26 @@ NSync = { var attachments = child.getAttachments() for(itemid of attachments) { - let transfer = true; - let ispriority = true; - let pw = ""; - await Zotero.PDFWorker.import(itemid, ispriority, pw, transfer); + let attachment = Zotero.Items.get(itemid); + if(attachment.isPDFAttachment) + { + try { + Zotero_File_Interface.Progress.show("Importing annotations "+itemid+" ... ") + let attachment = Zotero.Items.get(itemid) + let transfer = true; + let ispriority = true; + let pw = ""; + await Zotero.PDFWorker.import(itemid, ispriority, pw, transfer); + } + catch(error) + { + Zotero.log("Error importing annotations: "+error); + } + } + else + { + Zotero_File_Interface.Progress.show("File not PDF, skipping ... "); + } } } return true; diff --git a/install.rdf b/install.rdf index 9a5df36..82431e2 100644 --- a/install.rdf +++ b/install.rdf @@ -5,7 +5,7 @@ zenotes@alefa.net ZeNotes - 0.9.0 + 0.9.1 true https://raw.githubusercontent.com/frianasoa/zenotes/main/zenote-update.json https://github.com/frianasoa/zenotes diff --git a/manifest.json b/manifest.json index e1995e1..ab92112 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Ze Notes", - "version": "0.9.0", + "version": "0.9.1", "description": "Advanced notes manager", "homepage_url": "https://github.com/frianasoa/zenotes", "author": "Fanantenana Rianasoa Andriariniaina", diff --git a/zenote-update.json b/zenote-update.json index 0b03774..fffd857 100644 --- a/zenote-update.json +++ b/zenote-update.json @@ -3,9 +3,9 @@ "zenotes@alefa.net": { "updates": [ { - "version": "0.9.0", - "update_link": "https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.0/zenotes-v0.9.0.xpi", - "update_hash": "sha256:001441b3455fb9c59f67955ae71c00c7508fdfe118cbf370abbca082a67d6550", + "version": "0.9.1", + "update_link": "https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.1/zenotes-v0.9.1.xpi", + "update_hash": "sha256:8c88681afe533be3d56e750bd6d05613326c05421c44142400e0e7977e275e22", "applications": { "gecko": { "strict_min_version": "60.0" diff --git a/zenote-update.rdf b/zenote-update.rdf index 8c326a6..38edc9b 100644 --- a/zenote-update.rdf +++ b/zenote-update.rdf @@ -5,13 +5,13 @@ - 0.9.0 + 0.9.1 zotero@chnm.gmu.edu 5.0.0 6.* - https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.0/zenotes-v0.9.0.xpi + https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.1/zenotes-v0.9.1.xpi @@ -20,7 +20,7 @@ juris-m@juris-m.github.io 4.999 6.* - https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.0/zenotes-v0.9.0.xpi + https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.1/zenotes-v0.9.1.xpi