From e5e6d2530be1fdcf32f571adbb156597fcbe11b2 Mon Sep 17 00:00:00 2001 From: hrdrq Date: Sun, 3 Nov 2024 18:46:19 +0900 Subject: [PATCH] Add SetDueDate() and update notesInfo() --- plugin/__init__.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugin/__init__.py b/plugin/__init__.py index 9480a95..58ebdd8 100644 --- a/plugin/__init__.py +++ b/plugin/__init__.py @@ -1648,6 +1648,11 @@ class AnkiConnect: return result + @util.api() + def setDueDate(self, cards, days): + self.scheduler().set_due_date(cards, days, config_key=None) + return True + @util.api() def reloadCollection(self): @@ -1673,7 +1678,13 @@ class AnkiConnect: @util.api() - def notesInfo(self, notes): + def notesInfo(self, notes=None, query=None): + if notes is None and query is None: + raise Exception('Must provide either "notes" or a "query"') + + if query is not None: + notes = self.findNotes(query) + result = [] for nid in notes: try: