mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
rebuild q/a cache to include latex
This commit is contained in:
parent
7a196b3747
commit
f42a2e4a00
1 changed files with 7 additions and 3 deletions
10
anki/deck.py
10
anki/deck.py
|
@ -72,7 +72,7 @@ SEARCH_FIELD = 6
|
|||
SEARCH_FIELD_EXISTS = 7
|
||||
SEARCH_QA = 8
|
||||
SEARCH_PHRASE_WB = 9
|
||||
DECK_VERSION = 60
|
||||
DECK_VERSION = 61
|
||||
|
||||
deckVarsTable = Table(
|
||||
'deckVars', metadata,
|
||||
|
@ -4368,10 +4368,14 @@ update cards set due = created, combinedDue = created
|
|||
where relativeDelay = 2""")
|
||||
deck.version = 58
|
||||
deck.s.commit()
|
||||
if deck.version < 60:
|
||||
if deck.version < 61:
|
||||
# because we've changed the way latex is handled, we're going to
|
||||
# need to rebuild the q/a
|
||||
for m in deck.models:
|
||||
deck.updateCardsFromModel(m, dirty=False)
|
||||
# rebuild the media db based on new format
|
||||
rebuildMediaDir(deck, dirty=False)
|
||||
deck.version = 60
|
||||
deck.version = 61
|
||||
deck.s.commit()
|
||||
# executing a pragma here is very slow on large decks, so we store
|
||||
# our own record
|
||||
|
|
Loading…
Reference in a new issue