Add logging for PDF exports

This commit is contained in:
Dan Stillman 2022-04-30 05:16:41 -04:00
parent 9829ea7009
commit 5e0674b842

View file

@ -152,6 +152,8 @@ class PDFWorker {
if (!attachment.isPDFAttachment()) {
throw new Error('Item must be a PDF attachment');
}
let t = new Date();
Zotero.debug(`Exporting PDF for item ${attachment.libraryKey}`);
let items = attachment.getAnnotations();
items = items.filter(x => !x.annotationIsExternal);
let annotations = [];
@ -200,6 +202,8 @@ class PDFWorker {
await Zotero.Items.erase(items.map(x => x.id));
}
Zotero.debug(`Exported PDF with ${annotations.length} annotation(s) in ${new Date() - t} ms`);
return annotations.length;
}, isPriority);
}