From 28bb109dedf187208c5977733e3b8f2700e28a34 Mon Sep 17 00:00:00 2001 From: "Soren I. Bjornstad" Date: Thu, 19 Jun 2014 17:19:56 -0500 Subject: [PATCH] only display "added duplicate" message once Even if there are several (duplicate) notes in the collection that match, only send the message once to avoid making it look like multiple dupes have been added. --- anki/importing/noteimp.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/anki/importing/noteimp.py b/anki/importing/noteimp.py index c5669ffc6..fd3a7877a 100644 --- a/anki/importing/noteimp.py +++ b/anki/importing/noteimp.py @@ -118,6 +118,7 @@ class NoteImporter(Importer): self._cards = [] self._emptyNotes = False dupeCount = 0 + dupes = [] for n in notes: if not self.allowHTML: for c in range(len(n.fields)): @@ -159,7 +160,11 @@ class NoteImporter(Importer): dupeCount += 1 elif self.importMode == 2: # allow duplicates in this case - updateLog.append(dupeLogTxt % fld0) + if fld0 not in dupes: + # only show message once, no matter how many + # duplicates are in the collection already + updateLog.append(dupeLogTxt % fld0) + dupes.append(fld0) found = False # newly add if not found: