mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
workaround card ordering bug from older versions
This commit is contained in:
parent
7fc593a2ce
commit
cdac2bf8d7
1 changed files with 12 additions and 1 deletions
13
anki/deck.py
13
anki/deck.py
|
@ -69,7 +69,7 @@ SEARCH_FIELD = 6
|
||||||
SEARCH_FIELD_EXISTS = 7
|
SEARCH_FIELD_EXISTS = 7
|
||||||
SEARCH_QA = 8
|
SEARCH_QA = 8
|
||||||
SEARCH_PHRASE_WB = 9
|
SEARCH_PHRASE_WB = 9
|
||||||
DECK_VERSION = 57
|
DECK_VERSION = 58
|
||||||
|
|
||||||
deckVarsTable = Table(
|
deckVarsTable = Table(
|
||||||
'deckVars', metadata,
|
'deckVars', metadata,
|
||||||
|
@ -4313,6 +4313,17 @@ or quizFontFamily is null""")
|
||||||
deck.s.statement("analyze")
|
deck.s.statement("analyze")
|
||||||
deck.version = 57
|
deck.version = 57
|
||||||
deck.s.commit()
|
deck.s.commit()
|
||||||
|
if deck.version < 58:
|
||||||
|
# orderNewCards() had a bug in older versions where combinedDue
|
||||||
|
# was not updated, and since we're sorting on combinedDue now we
|
||||||
|
# need to make sure it's correct. This will discard any spacing
|
||||||
|
# the cards had.
|
||||||
|
if deck.newCardOrder != 0:
|
||||||
|
deck.s.statement("""
|
||||||
|
update cards set due = created, combinedDue = created
|
||||||
|
where relativeDelay = 2""")
|
||||||
|
deck.version = 58
|
||||||
|
deck.s.commit()
|
||||||
# executing a pragma here is very slow on large decks, so we store
|
# executing a pragma here is very slow on large decks, so we store
|
||||||
# our own record
|
# our own record
|
||||||
if not deck.getInt("pageSize") == 4096:
|
if not deck.getInt("pageSize") == 4096:
|
||||||
|
|
Loading…
Reference in a new issue