add api_addNotes api
This commit is contained in:
parent
6316e9e76f
commit
0ec041f9fc
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user