From a2bbb03f13735df00556e70672cbc8cfdb3237cf Mon Sep 17 00:00:00 2001 From: kulst <60887784+kulst@users.noreply.github.com> Date: Sun, 23 Nov 2025 20:04:56 +0100 Subject: [PATCH] fix: make -u option work again for add-from-file and update-from-file commands Callers of add_notes_from_file in cli.py did not consider the new argument respect_note_ids as the second to last argument. Therefore, update_file was wrongly passed into respect_note_ids and not update_origin_file. This lead to the file never being updated. Changing the argument order fixes this. --- src/apyanki/anki.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apyanki/anki.py b/src/apyanki/anki.py index 322d5f2..0e14e04 100644 --- a/src/apyanki/anki.py +++ b/src/apyanki/anki.py @@ -529,8 +529,8 @@ def add_notes_from_file( filename: str, tags: str = "", deck: str | None = None, - respect_note_ids: bool = True, update_origin_file: bool = False, + respect_note_ids: bool = True, ) -> list[Note]: """Add notes from Markdown file @@ -538,10 +538,10 @@ def add_notes_from_file( filename: Path to the markdown file containing notes tags: Additional tags to add to the notes deck: Default deck for notes without a deck specified + update_origin_file: If True, update the original file with note IDs respect_note_ids: If True, then this function looks for nid: or cid: headers in the file to determine if a note should be updated rather than added. - update_origin_file: If True, update the original file with note IDs Returns: List of notes that were updated or added