Skip to content

Commit

Permalink
fix: deprecation of addAvailablePDF
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanChain committed Nov 6, 2024
1 parent 91a5d73 commit 6b1ce2e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

</details>

Expand Down
4 changes: 2 additions & 2 deletions src/modules/arxiv-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
);
Expand Down
4 changes: 2 additions & 2 deletions src/modules/update-pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6b1ce2e

Please sign in to comment.