fix deck list not being consistent with study screen

We must make sure to bound each deck by its current remaining, not its daily
limit. Fixes counts when "study more" used, and also counts where there are
more cards due than can be shown
This commit is contained in:
Damien Elmes 2012-10-23 22:07:24 +09:00
parent 96b0087262
commit 31e2f927c7

View file

@ -263,9 +263,10 @@ order by due""" % self._deckLimit(),
new += ch[4]
# limit the counts to the deck's limits
conf = self.col.decks.confForDid(did)
deck = self.col.decks.get(did)
if not conf['dyn']:
rev = min(rev, conf['rev']['perDay'])
new = min(new, conf['new']['perDay'])
rev = min(rev, conf['rev']['perDay']-deck['revToday'][1])
new = min(new, conf['new']['perDay']-deck['newToday'][1])
tree.append((head, did, rev, lrn, new, children))
return tuple(tree)