only duplicate notes with diff schema in anki1 import (#612)

This commit is contained in:
Damien Elmes 2013-05-24 11:55:28 +09:00
parent e6ecbfd086
commit 73b197b3a9
2 changed files with 4 additions and 1 deletions

View file

@ -9,6 +9,8 @@ from anki.importing.anki2 import Anki2Importer
class Anki1Importer(Anki2Importer):
dupeOnSchemaChange = True
def run(self):
u = Upgrader()
# check

View file

@ -17,6 +17,7 @@ class Anki2Importer(Importer):
needMapper = False
deckPrefix = None
allowUpdate = True
dupeOnSchemaChange = False
def run(self, media=None):
self._prepareFiles()
@ -110,7 +111,7 @@ class Anki2Importer(Importer):
srcMid = note[MID]
dstMid = self._mid(srcMid)
# duplicate schemas?
if srcMid == dstMid:
if srcMid == dstMid or not self.dupeOnSchemaChange:
return origGuid not in self._notes
# differing schemas
note[MID] = dstMid