diff --git a/anki/importing/anki2.py b/anki/importing/anki2.py index 616a1d167..3e89c65ce 100644 --- a/anki/importing/anki2.py +++ b/anki/importing/anki2.py @@ -117,6 +117,11 @@ class Anki2Importer(Importer): # if it doesn't exist, we'll copy it over, preserving id if not self.dst.models.have(mid): self.dst.models.update(src) + # if we're importing with a prefix, make the model default to it + if self.deckPrefix: + src['did'] = self.dst.decks.current()['id'] + # and give it a unique name + src['name'] += " (%s)" % self.deckPrefix # make sure to bump usn self.dst.models.save(src) self._modelMap[mid] = mid