From 6b1ce2e63071606d5920c2569f2b9df8804bd05f Mon Sep 17 00:00:00 2001 From: Allan Chain <36528777+AllanChain@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:10:03 +0800 Subject: [PATCH] fix: deprecation of addAvailablePDF --- README.md | 2 +- src/modules/arxiv-update.ts | 4 ++-- src/modules/update-pdf.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8d78a75..76ac30f 100644 --- a/README.md +++ b/README.md @@ -210,7 +210,7 @@ async Zotero.arXivWorkflow.updatePDF( This function assumes that the argument is an journal item, and no checks will be performed to ensure this. The function caller is responsible to perform the checks. -Under the hood, this just calls `Zotero.Attachments.addAvailablePDF` and limits the download source to DOI only. +Under the hood, this just calls `Zotero.Attachments.addAvailableFile` and limits the download source to DOI only. diff --git a/src/modules/arxiv-update.ts b/src/modules/arxiv-update.ts index 6a481b3..763b1e1 100644 --- a/src/modules/arxiv-update.ts +++ b/src/modules/arxiv-update.ts @@ -97,10 +97,10 @@ export class arXivUpdate { ) { popupWin.changeLine({ text: tr("download-pdf"), progress: 60 }); popupWin.show(-1); - const attachment = await Zotero.Attachments.addAvailablePDF( + // @ts-ignore zotero-type mistake + const attachment = await Zotero.Attachments.addAvailableFile( journalItem, { - // @ts-ignore zotero-type mistake methods: ["doi"], // Only download from publisher }, ); diff --git a/src/modules/update-pdf.ts b/src/modules/update-pdf.ts index 21b8427..bc78247 100644 --- a/src/modules/update-pdf.ts +++ b/src/modules/update-pdf.ts @@ -37,9 +37,9 @@ export class UpdatePDF { progress: 0, }); popupWin.show(-1); - const attachmentItem = await Zotero.Attachments.addAvailablePDF( + // @ts-ignore zotero-type mistake + const attachmentItem = await Zotero.Attachments.addAvailableFile( journalItem, - // @ts-ignore zotero-type mistake { methods: ["doi"] }, // Only download from publisher ); if (attachmentItem) {