diff --git a/AnkiConnect.py b/AnkiConnect.py index 0d2c13d..7a4112d 100644 --- a/AnkiConnect.py +++ b/AnkiConnect.py @@ -28,7 +28,7 @@ import socket # Constants # -API_VERSION = 1 +API_VERSION = 2 URL_TIMEOUT = 10 @@ -417,6 +417,20 @@ class AnkiConnect: ) + def api_addNotes(self, notes): + results = [] + for note in notes: + results.append(self.anki.addNote( + note['deckName'], + note['modelName'], + note['fields'], + note['tags'], + note.get('audio') + )) + + return results + + def api_canAddNotes(self, notes): results = [] for note in notes: