mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 07:07:13 -05:00
mark cards modified when randomizing/ordering
This commit is contained in:
parent
ae7047f5af
commit
35837ef213
1 changed files with 8 additions and 4 deletions
12
anki/deck.py
12
anki/deck.py
|
|
@ -523,11 +523,14 @@ where id in %s""" % ids2str(ids), now=time.time(), new=0)
|
||||||
now = time.time()
|
now = time.time()
|
||||||
fids = self.s.column0("""
|
fids = self.s.column0("""
|
||||||
select distinct factId from cards where type = 2""")
|
select distinct factId from cards where type = 2""")
|
||||||
data = [{'fid': fid, 'rand': random.uniform(0, now)} for fid in fids]
|
data = [{'fid': fid,
|
||||||
|
'rand': random.uniform(0, now),
|
||||||
|
'now': now} for fid in fids]
|
||||||
self.s.statements("""
|
self.s.statements("""
|
||||||
update cards
|
update cards
|
||||||
set due = :rand + ordinal,
|
set due = :rand + ordinal,
|
||||||
combinedDue = max(:rand + ordinal, spaceUntil)
|
combinedDue = max(:rand + ordinal, spaceUntil),
|
||||||
|
modified = :now
|
||||||
where factId = :fid
|
where factId = :fid
|
||||||
and type = 2""", data)
|
and type = 2""", data)
|
||||||
self.finishProgress()
|
self.finishProgress()
|
||||||
|
|
@ -539,8 +542,9 @@ and type = 2""", data)
|
||||||
self.s.statement("""
|
self.s.statement("""
|
||||||
update cards set
|
update cards set
|
||||||
due = created,
|
due = created,
|
||||||
combinedDue = max(spaceUntil, due)
|
combinedDue = max(spaceUntil, due),
|
||||||
where type = 2""")
|
modified = :now
|
||||||
|
where type = 2""", now=time.time())
|
||||||
self.finishProgress()
|
self.finishProgress()
|
||||||
|
|
||||||
def rescheduleCards(self, ids, min, max):
|
def rescheduleCards(self, ids, min, max):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue