mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
report # of notes that are already in the collection
This commit is contained in:
parent
c127f4b3c8
commit
da639c00a5
2 changed files with 5 additions and 1 deletions
|
@ -69,6 +69,7 @@ class Anki2Importer(Importer):
|
|||
add = []
|
||||
dirty = []
|
||||
usn = self.dst.usn()
|
||||
dupes = 0
|
||||
for note in self.src.db.execute(
|
||||
"select * from notes"):
|
||||
# turn the db result into a mutable list
|
||||
|
@ -90,6 +91,7 @@ class Anki2Importer(Importer):
|
|||
# note we have the added note
|
||||
self._notes[guid] = (note[0], note[3], note[2])
|
||||
else:
|
||||
dupes += 1
|
||||
pass
|
||||
## update existing note - not yet tested; for post 2.0
|
||||
# newer = note[3] > mod
|
||||
|
@ -99,6 +101,9 @@ class Anki2Importer(Importer):
|
|||
# note[4] = usn
|
||||
# add.append(note)
|
||||
# dirty.append(note[0])
|
||||
if dupes:
|
||||
self.log.append(_("Already in collection: %s.") % (ngettext(
|
||||
"%d note", "%d notes", dupes) % dupes))
|
||||
# add to col
|
||||
self.dst.db.executemany(
|
||||
"insert or replace into notes values (?,?,?,?,?,?,?,?,?,?,?)",
|
||||
|
|
|
@ -151,7 +151,6 @@ class NoteImporter(Importer):
|
|||
# apply scheduling updates
|
||||
self.updateCards()
|
||||
# make sure to update sflds, etc
|
||||
|
||||
part1 = ngettext("%d note added", "%d notes added", len(new)) % len(new)
|
||||
part2 = ngettext("%d note updated", "%d notes updated", self.updateCount) % self.updateCount
|
||||
self.log.append("%s, %s." % (part1, part2))
|
||||
|
|
Loading…
Reference in a new issue