From 8bfb4049dcecab2b3b55f113df3c4af9e31515b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Matthias=20Sch=C3=A4fer?= Date: Mon, 7 Oct 2024 21:54:40 +0200 Subject: [PATCH] Replace duplicate code with call to addMediaFromNote --- plugin/__init__.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/plugin/__init__.py b/plugin/__init__.py index d488b87..ad6d068 100644 --- a/plugin/__init__.py +++ b/plugin/__init__.py @@ -820,14 +820,7 @@ class AnkiConnect: if name in ankiNote: ankiNote[name] = value - audioObjectOrList = note.get('audio') - self.addMedia(ankiNote, audioObjectOrList, util.MediaType.Audio) - - videoObjectOrList = note.get('video') - self.addMedia(ankiNote, videoObjectOrList, util.MediaType.Video) - - pictureObjectOrList = note.get('picture') - self.addMedia(ankiNote, pictureObjectOrList, util.MediaType.Picture) + self.addMediaFromNote(ankiNote, note) self.collection().update_note(ankiNote, skip_undo_entry=True);