mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
remove study card count cap in v2 sched
- cap kept for the deck list, as we need to calculate it for multiple decks - v2 sched can calculate review limit faster, as it doesn't have to check each deck separately - filtered deck cap is same as in interface - as this will be deployed on ankiweb, beta clients will need to update or risk getting sanity check errors when syncing with high due counts
This commit is contained in:
parent
b64bfe858b
commit
6bd1eed9b6
2 changed files with 14 additions and 12 deletions
|
@ -30,6 +30,7 @@ class Scheduler:
|
||||||
self.col = col
|
self.col = col
|
||||||
self.queueLimit = 50
|
self.queueLimit = 50
|
||||||
self.reportLimit = 1000
|
self.reportLimit = 1000
|
||||||
|
self.dynReportLimit = 99999
|
||||||
self.reps = 0
|
self.reps = 0
|
||||||
self.today = None
|
self.today = None
|
||||||
self._haveQueues = False
|
self._haveQueues = False
|
||||||
|
@ -428,7 +429,7 @@ select count() from
|
||||||
def _deckNewLimitSingle(self, g):
|
def _deckNewLimitSingle(self, g):
|
||||||
"Limit for deck without parent limits."
|
"Limit for deck without parent limits."
|
||||||
if g['dyn']:
|
if g['dyn']:
|
||||||
return self.reportLimit
|
return self.dynReportLimit
|
||||||
c = self.col.decks.confForDid(g['id'])
|
c = self.col.decks.confForDid(g['id'])
|
||||||
return max(0, c['new']['perDay'] - g['newToday'][1])
|
return max(0, c['new']['perDay'] - g['newToday'][1])
|
||||||
|
|
||||||
|
@ -447,19 +448,19 @@ select id from cards where did in %s and queue = 0 limit ?)"""
|
||||||
|
|
||||||
# sub-day
|
# sub-day
|
||||||
self.lrnCount = self.col.db.scalar("""
|
self.lrnCount = self.col.db.scalar("""
|
||||||
select count() from (select null from cards where did in %s and queue = 1
|
select count() from cards where did in %s and queue = 1
|
||||||
and due < ? limit %d)""" % (
|
and due < ?""" % (
|
||||||
self._deckLimit(), self.reportLimit),
|
self._deckLimit()),
|
||||||
cutoff) or 0
|
cutoff) or 0
|
||||||
# day
|
# day
|
||||||
self.lrnCount += self.col.db.scalar("""
|
self.lrnCount += self.col.db.scalar("""
|
||||||
select count() from (select null from cards where did in %s and queue = 3
|
select count() from cards where did in %s and queue = 3
|
||||||
and due <= ? limit %d)""" % (self._deckLimit(), self.reportLimit),
|
and due <= ?""" % (self._deckLimit()),
|
||||||
self.today)
|
self.today)
|
||||||
# previews
|
# previews
|
||||||
self.lrnCount += self.col.db.scalar("""
|
self.lrnCount += self.col.db.scalar("""
|
||||||
select count() from (select null from cards where did in %s and queue = 4
|
select count() from cards where did in %s and queue = 4
|
||||||
limit %d)""" % (self._deckLimit(), self.reportLimit))
|
""" % (self._deckLimit()))
|
||||||
|
|
||||||
def _resetLrn(self):
|
def _resetLrn(self):
|
||||||
self._resetLrnCount()
|
self._resetLrnCount()
|
||||||
|
@ -735,7 +736,7 @@ and due <= ? limit ?)""",
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if d['dyn']:
|
if d['dyn']:
|
||||||
return self.reportLimit
|
return self.dynReportLimit
|
||||||
|
|
||||||
c = self.col.decks.confForDid(d['id'])
|
c = self.col.decks.confForDid(d['id'])
|
||||||
lim = max(0, c['rev']['perDay'] - d['revToday'][1])
|
lim = max(0, c['rev']['perDay'] - d['revToday'][1])
|
||||||
|
|
|
@ -162,9 +162,10 @@ to their original deck.""")
|
||||||
def _table(self):
|
def _table(self):
|
||||||
counts = list(self.mw.col.sched.counts())
|
counts = list(self.mw.col.sched.counts())
|
||||||
finished = not sum(counts)
|
finished = not sum(counts)
|
||||||
for n in range(len(counts)):
|
if self.mw.col.schedVer() == 1:
|
||||||
if counts[n] >= 1000:
|
for n in range(len(counts)):
|
||||||
counts[n] = "1000+"
|
if counts[n] >= 1000:
|
||||||
|
counts[n] = "1000+"
|
||||||
but = self.mw.button
|
but = self.mw.button
|
||||||
if finished:
|
if finished:
|
||||||
return '<div style="white-space: pre-wrap;">%s</div>' % (
|
return '<div style="white-space: pre-wrap;">%s</div>' % (
|
||||||
|
|
Loading…
Reference in a new issue