From efe454f64243ad7032cc79ae9740e0fd7d2664c6 Mon Sep 17 00:00:00 2001 From: orgtre Date: Mon, 31 Oct 2022 10:47:58 +0100 Subject: [PATCH] Update deck for all cards of a note Update decks as suggested by louietan/anki-editor#85. ccd7f773226948dbf0e82e51cf3a0710670ae636 only updated one card. --- anki-editor.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/anki-editor.el b/anki-editor.el index a7a58d4..49b9d54 100644 --- a/anki-editor.el +++ b/anki-editor.el @@ -523,11 +523,7 @@ Where the subtree is created depends on PREFIX." :notes (list (string-to-number (anki-editor-note-id note)))) (anki-editor-api-enqueue 'updateNoteFields - :note (anki-editor-api--note note)) - (anki-editor-api-enqueue 'changeDeck - :cards (list (string-to-number (anki-editor-note-id note))) - :deck (anki-editor-note-deck note)) - ))) + :note (anki-editor-api--note note))))) (tagsadd (cl-set-difference (anki-editor-note-tags note) (alist-get 'tags oldnote) :test 'string=)) @@ -535,6 +531,10 @@ Where the subtree is created depends on PREFIX." (cl-set-difference (anki-editor-note-tags note) :test 'string=) (cl-set-difference anki-editor-protected-tags :test 'string=)))) (anki-editor-api-with-multi + (anki-editor-api-enqueue 'changeDeck + :cards (alist-get 'cards oldnote) + :deck (anki-editor-note-deck note)) + (when tagsadd (anki-editor-api-enqueue 'addTags :notes (list (string-to-number