mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
don't break older clients with new delay1 setting
This commit is contained in:
parent
cdac2bf8d7
commit
e5d9697d28
1 changed files with 9 additions and 5 deletions
14
anki/deck.py
14
anki/deck.py
|
@ -969,7 +969,12 @@ and type between 1 and 2""",
|
||||||
"Return time when CARD will expire given EASE."
|
"Return time when CARD will expire given EASE."
|
||||||
if ease == 1:
|
if ease == 1:
|
||||||
if oldState == "mature":
|
if oldState == "mature":
|
||||||
due = 0 + self.delay1*86400
|
# FIXME: magic value until we have old clients updated
|
||||||
|
if self.delay1 == 600:
|
||||||
|
d = 0
|
||||||
|
else:
|
||||||
|
d = self.delay1
|
||||||
|
due = 0 + d*86400
|
||||||
else:
|
else:
|
||||||
due = 0
|
due = 0
|
||||||
else:
|
else:
|
||||||
|
@ -3681,10 +3686,9 @@ class DeckStorage(object):
|
||||||
deck.s.statement("""
|
deck.s.statement("""
|
||||||
update cards set type = type - 3 where type between 0 and 2 and priority = -3""")
|
update cards set type = type - 3 where type between 0 and 2 and priority = -3""")
|
||||||
# - new delay1 handling
|
# - new delay1 handling
|
||||||
if deck.delay0 == deck.delay1:
|
if deck.delay1 > 7:
|
||||||
deck.delay1 = 0
|
# we treat 600==0 to avoid breaking older clients
|
||||||
else:
|
deck.delay1 = 600
|
||||||
deck.delay1 = min(deck.delay1, 7)
|
|
||||||
# unsuspend buried/rev early - can remove priorities in the future
|
# unsuspend buried/rev early - can remove priorities in the future
|
||||||
ids = deck.s.column0(
|
ids = deck.s.column0(
|
||||||
"select id from cards where type > 2 or priority between -2 and -1")
|
"select id from cards where type > 2 or priority between -2 and -1")
|
||||||
|
|
Loading…
Reference in a new issue