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.
This commit is contained in:
Soren I. Bjornstad 2014-06-19 17:19:56 -05:00
parent 5e74976361
commit 28bb109ded

View file

@ -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
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: