mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
vacuum after import; make sure models.current() always returns
This commit is contained in:
parent
1772474765
commit
b31bd5c091
2 changed files with 5 additions and 1 deletions
|
@ -41,6 +41,8 @@ class Anki2Importer(Importer):
|
|||
self._importFacts()
|
||||
self._importCards()
|
||||
self._importMedia()
|
||||
self.dst.db.execute("vacuum")
|
||||
self.dst.db.execute("analyze")
|
||||
|
||||
# Facts
|
||||
######################################################################
|
||||
|
|
|
@ -94,7 +94,9 @@ class ModelManager(object):
|
|||
def current(self):
|
||||
"Get current model."
|
||||
try:
|
||||
return self.get(self.deck.groups.top()['curModel'])
|
||||
m = self.get(self.deck.groups.top()['curModel'])
|
||||
assert m
|
||||
return m
|
||||
except:
|
||||
return self.models.values()[0]
|
||||
|
||||
|
|
Loading…
Reference in a new issue