WIP
This commit is contained in:
parent
26d3fa3106
commit
39deb87c42
@ -107,17 +107,19 @@ class AnkiConnect:
|
|||||||
|
|
||||||
|
|
||||||
def apiCanAddNotes(self, params):
|
def apiCanAddNotes(self, params):
|
||||||
|
results = []
|
||||||
for definition in params:
|
for definition in params:
|
||||||
results = definition['addable'] = definition.get('addable', {})
|
state = {}
|
||||||
|
results.append(state)
|
||||||
for mode in ['vocabExp', 'vocabReading', 'kanji']:
|
for mode in ['vocabExp', 'vocabReading', 'kanji']:
|
||||||
args = self.prepareNoteArgs(definition, mode)
|
args = self.prepareNoteArgs(definition, mode)
|
||||||
results[mode] = args is not None and self.anki.canAddNote(
|
state[mode] = args is not None and self.anki.canAddNote(
|
||||||
args['deck'],
|
args['deck'],
|
||||||
args['model'],
|
args['model'],
|
||||||
args['fields']
|
args['fields']
|
||||||
)
|
)
|
||||||
|
|
||||||
return params
|
return results
|
||||||
|
|
||||||
|
|
||||||
def apiGetVersion(self, params):
|
def apiGetVersion(self, params):
|
||||||
|
Loading…
Reference in New Issue
Block a user