From 39deb87c42320ee3808011344a833d1deadc99cf Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Thu, 5 May 2016 20:06:36 -0700 Subject: [PATCH] WIP --- yomi_base/anki_connect.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yomi_base/anki_connect.py b/yomi_base/anki_connect.py index 945288e..ed7dee5 100644 --- a/yomi_base/anki_connect.py +++ b/yomi_base/anki_connect.py @@ -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):