From 0fa9b75af555ef17f890bd54dff5a46826080ae8 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 11 Jul 2013 18:47:49 +0900 Subject: [PATCH] fix importing with schema change logic the previous fix for #612 was broken, and led to notes with altered schemas being imported with the incorrect schema --- anki/importing/anki2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/anki/importing/anki2.py b/anki/importing/anki2.py index d2a3a0ba8..f4d3bfd47 100644 --- a/anki/importing/anki2.py +++ b/anki/importing/anki2.py @@ -111,14 +111,16 @@ class Anki2Importer(Importer): srcMid = note[MID] dstMid = self._mid(srcMid) # duplicate schemas? - if srcMid == dstMid or not self.dupeOnSchemaChange: + if srcMid == dstMid: return origGuid not in self._notes - # differing schemas + # differing schemas and note doesn't exist? note[MID] = dstMid if origGuid not in self._notes: return True # as the schemas differ and we already have a note with a different # note type, this note needs a new guid + if not self.dupeOnSchemaChange: + return False while True: note[GUID] = incGuid(note[GUID]) self._changedGuids[origGuid] = note[GUID]