Skip to content

Commit

Permalink
Fix KeyError on missing AnkiPro media files
Browse files Browse the repository at this point in the history
  • Loading branch information
abdnh committed Jul 21, 2024
1 parent 6575b79 commit 8c2443d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/importers/ankipro.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def _import_cards(self) -> int:
media_ids = media_side_map.get(side, [])
if media_ids:
contents += "<br>".join(
media_refs_map[id] for id in media_ids
media_refs_map[id]
for id in media_ids
if id in media_refs_map
)
contents += note_dict["fields"][side]
note.fields[i] = contents
Expand Down

0 comments on commit 8c2443d

Please sign in to comment.