From b8e63c383da11f1268bc94bbf84e9556c3ee181f Mon Sep 17 00:00:00 2001 From: David Bailey Date: Thu, 27 Jul 2017 18:32:34 +0100 Subject: [PATCH] Add multi function --- AnkiConnect.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/AnkiConnect.py b/AnkiConnect.py index 35ec7cf..130ae2a 100644 --- a/AnkiConnect.py +++ b/AnkiConnect.py @@ -428,6 +428,13 @@ class AnkiBridge: return [field['name'] for field in model['flds']] + def multi(self, actions): + response = [] + for item in actions: + response.append(AnkiConnect.handler(ac, item)) + return response + + def deckNames(self): collection = self.collection() if collection is not None: @@ -620,6 +627,11 @@ class AnkiConnect: return self.anki.modelFieldNames(modelName) + @webApi + def multi(self, actions): + return self.anki.multi(actions) + + @webApi def addNote(self, note): params = AnkiNoteParams(note)