add api_addNotes api

This commit is contained in:
Alex Yatskov 2017-02-05 12:09:12 -08:00
parent 6316e9e76f
commit 0ec041f9fc

View File

@ -28,7 +28,7 @@ import socket
# Constants # Constants
# #
API_VERSION = 1 API_VERSION = 2
URL_TIMEOUT = 10 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): def api_canAddNotes(self, notes):
results = [] results = []
for note in notes: for note in notes: