mgmeyers / obsidian-zotero-integration

Insert and import citations, bibliographies, notes, and PDF annotations from Zotero into Obsidian.
GNU General Public License v3.0
1.09k stars 55 forks source link

FR: skip importing annotations from PDF files which were not found #318

Open nicolnt opened 11 months ago

nicolnt commented 11 months ago

Hi,

Is it possible to add a feature to let the plugin skip file that were missing or seem broken in Zotero library when importing?

My situation is that I've moved from one laptop to another (no access to previous files) and many of my attachments were added using "Attach Link to File" method, so most of my library is broken now. So when using Obsidian Zotero Integration plugin creates a reference in my vault it fails with these references containing a PDF which comes missing on my new laptop.

A possible workaround would be to use zotero-storage-scanner to detect all broken attachments and remove them. However, it is somewhat a wrong approach. Indeed, I would lose all annotations saved in Zotero for these PDF documents that I should normally be able to recover if I can get a copy of the same file.

Here is an example of an error message I get:

Error processing PDF: Command failed with exit code 1: C:\Users\LIENART\Documents\MEGA\Cerveau\.obsidian\plugins\obsidian-zotero-desktop-connector\pdfannots2json.exe /Users/n.lienart/Documents/3_BIBLIO/Énergie/2020_Martínez_Optimised production of tailored syngas from municipal solid waste (MSW) by sorption-enhanced gasification.pdf -w -n base_name -d 120 -f jpg -o C:\Users\LIENART\Documents\MEGA\Cerveau\output_path -q 90
open C:\Users\n.lienart\Documents\3_BIBLIO\Énergie\2020_Martínez_Optimised production of tailored syngas from municipal solid waste (MSW) by sorption-enhanced gasification.pdf: Le chemin d’accès spécifié est introuvable.
FeralFlora commented 8 months ago

My situation is that I've moved from one laptop to another (no access to previous files) and many of my attachments were added using "Attach Link to File" method, so most of my library is broken now.

If you had access to the files, you could change the base directory to fix the links: Edit -> Settings -> Advanced -> Files and Folders -> Base directory

Nevertheless, it makes sense to add some handling for when links are broken.