1
This commit is contained in:
Alex Yatskov 2016-05-05 20:06:36 -07:00
parent 26d3fa3106
commit 39deb87c42

View File

@ -107,17 +107,19 @@ class AnkiConnect:
def apiCanAddNotes(self, params):
results = []
for definition in params:
results = definition['addable'] = definition.get('addable', {})
state = {}
results.append(state)
for mode in ['vocabExp', 'vocabReading', 'kanji']:
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['model'],
args['fields']
)
return params
return results
def apiGetVersion(self, params):