mirror of
https://github.com/ankitects/anki.git
synced 2025-11-14 08:37:11 -05:00
if updating priorities results in a suspend, update due counts
This commit is contained in:
parent
961db76e63
commit
f32f96fb53
1 changed files with 4 additions and 2 deletions
|
|
@ -811,9 +811,11 @@ group by cardTags.cardId""" % ids2str(cardIds))
|
||||||
self.s.statements(
|
self.s.statements(
|
||||||
"update cards set priority = :pri %s where id = :id" % extra,
|
"update cards set priority = :pri %s where id = :id" % extra,
|
||||||
[{'id': c[0], 'pri': c[1], 'm': time.time()} for c in cards])
|
[{'id': c[0], 'pri': c[1], 'm': time.time()} for c in cards])
|
||||||
self.s.execute(
|
cnt = self.s.execute(
|
||||||
"update cards set isDue = 0 where type in (0,1,2) and "
|
"update cards set isDue = 0 where type in (0,1,2) and "
|
||||||
"priority = 0 and isDue = 1")
|
"priority = 0 and isDue = 1").rowcount
|
||||||
|
if cnt:
|
||||||
|
self.rebuildCounts(full=False)
|
||||||
|
|
||||||
def updatePriority(self, card):
|
def updatePriority(self, card):
|
||||||
"Update priority on a single card."
|
"Update priority on a single card."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue