mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
IGNORE_MODE
This commit is contained in:
parent
a2eea7a1bb
commit
cb7429c433
1 changed files with 4 additions and 3 deletions
|
@ -53,9 +53,10 @@ class ForeignCard:
|
||||||
|
|
||||||
# The import mode is one of:
|
# The import mode is one of:
|
||||||
# UPDATE_MODE: update if first field matches existing note
|
# UPDATE_MODE: update if first field matches existing note
|
||||||
# 1: ignore if first field matches existing note
|
# IGNORE_MODE: ignore if first field matches existing note
|
||||||
# 2: import even if first field matches existing note
|
# 2: import even if first field matches existing note
|
||||||
UPDATE_MODE = 0
|
UPDATE_MODE = 0
|
||||||
|
IGNORE_MODE = 1
|
||||||
|
|
||||||
|
|
||||||
class NoteImporter(Importer):
|
class NoteImporter(Importer):
|
||||||
|
@ -176,7 +177,7 @@ class NoteImporter(Importer):
|
||||||
updateLog.append(updateLogTxt % fld0)
|
updateLog.append(updateLogTxt % fld0)
|
||||||
dupeCount += 1
|
dupeCount += 1
|
||||||
found = True
|
found = True
|
||||||
elif self.importMode == 1:
|
elif self.importMode == IGNORE_MODE:
|
||||||
dupeCount += 1
|
dupeCount += 1
|
||||||
elif self.importMode == 2:
|
elif self.importMode == 2:
|
||||||
# allow duplicates in this case
|
# allow duplicates in this case
|
||||||
|
@ -217,7 +218,7 @@ class NoteImporter(Importer):
|
||||||
)
|
)
|
||||||
if self.importMode == UPDATE_MODE:
|
if self.importMode == UPDATE_MODE:
|
||||||
unchanged = dupeCount - self.updateCount
|
unchanged = dupeCount - self.updateCount
|
||||||
elif self.importMode == 1:
|
elif self.importMode == IGNORE_MODE:
|
||||||
unchanged = dupeCount
|
unchanged = dupeCount
|
||||||
else:
|
else:
|
||||||
unchanged = 0
|
unchanged = 0
|
||||||
|
|
Loading…
Reference in a new issue