Save note after field update (#287)
Signed-off-by: Marcel Graber <marcel@clever.design>
This commit is contained in:
parent
5bb02e7d21
commit
335de469c3
@ -730,6 +730,7 @@ class AnkiConnect:
|
|||||||
def updateNoteFields(self, note):
|
def updateNoteFields(self, note):
|
||||||
ankiNote = self.getNote(note['id'])
|
ankiNote = self.getNote(note['id'])
|
||||||
|
|
||||||
|
self.startEditing()
|
||||||
for name, value in note['fields'].items():
|
for name, value in note['fields'].items():
|
||||||
if name in ankiNote:
|
if name in ankiNote:
|
||||||
ankiNote[name] = value
|
ankiNote[name] = value
|
||||||
@ -745,6 +746,9 @@ class AnkiConnect:
|
|||||||
|
|
||||||
ankiNote.flush()
|
ankiNote.flush()
|
||||||
|
|
||||||
|
self.collection().autosave()
|
||||||
|
self.stopEditing()
|
||||||
|
|
||||||
|
|
||||||
@util.api()
|
@util.api()
|
||||||
def addTags(self, notes, tags, add=True):
|
def addTags(self, notes, tags, add=True):
|
||||||
|
Loading…
Reference in New Issue
Block a user