mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
only duplicate notes with diff schema in anki1 import (#612)
This commit is contained in:
parent
e6ecbfd086
commit
73b197b3a9
2 changed files with 4 additions and 1 deletions
|
@ -9,6 +9,8 @@ from anki.importing.anki2 import Anki2Importer
|
||||||
|
|
||||||
class Anki1Importer(Anki2Importer):
|
class Anki1Importer(Anki2Importer):
|
||||||
|
|
||||||
|
dupeOnSchemaChange = True
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
u = Upgrader()
|
u = Upgrader()
|
||||||
# check
|
# check
|
||||||
|
|
|
@ -17,6 +17,7 @@ class Anki2Importer(Importer):
|
||||||
needMapper = False
|
needMapper = False
|
||||||
deckPrefix = None
|
deckPrefix = None
|
||||||
allowUpdate = True
|
allowUpdate = True
|
||||||
|
dupeOnSchemaChange = False
|
||||||
|
|
||||||
def run(self, media=None):
|
def run(self, media=None):
|
||||||
self._prepareFiles()
|
self._prepareFiles()
|
||||||
|
@ -110,7 +111,7 @@ class Anki2Importer(Importer):
|
||||||
srcMid = note[MID]
|
srcMid = note[MID]
|
||||||
dstMid = self._mid(srcMid)
|
dstMid = self._mid(srcMid)
|
||||||
# duplicate schemas?
|
# duplicate schemas?
|
||||||
if srcMid == dstMid:
|
if srcMid == dstMid or not self.dupeOnSchemaChange:
|
||||||
return origGuid not in self._notes
|
return origGuid not in self._notes
|
||||||
# differing schemas
|
# differing schemas
|
||||||
note[MID] = dstMid
|
note[MID] = dstMid
|
||||||
|
|
Loading…
Reference in a new issue