mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
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:
parent
5e74976361
commit
28bb109ded
1 changed files with 6 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue