add inactive argument to cramCardTags() so it performs like standard

This commit is contained in:
Damien Elmes 2010-11-12 12:49:30 +09:00
parent 6ed0bc91bb
commit 1b411938bf

View file

@ -560,7 +560,8 @@ select count() from cards where type = 2 and combinedDue < :now
self.newCount = 0 self.newCount = 0
self.newCountToday = 0 self.newCountToday = 0
def _cramCardLimit(self, active, sql): def _cramCardLimit(self, active, inactive, sql):
# inactive is (currently) ignored
if isinstance(active, list): if isinstance(active, list):
return sql.replace("where ", "where +c.id in " + ids2str(active)) return sql.replace("where ", "where +c.id in " + ids2str(active))
else: else:
@ -577,7 +578,7 @@ select count() from cards where type = 2 and combinedDue < :now
def _fillCramQueue(self): def _fillCramQueue(self):
if self.revCount and not self.revQueue: if self.revCount and not self.revQueue:
self.revQueue = self.s.all(self.cardLimit( self.revQueue = self.s.all(self.cardLimit(
self.activeCramTags, """ self.activeCramTags, "", """
select id, factId from cards c select id, factId from cards c
where type between 0 and 2 where type between 0 and 2
order by %s order by %s
@ -586,7 +587,7 @@ limit %s""" % (self.cramOrder, self.queueLimit)))
def _rebuildCramCount(self): def _rebuildCramCount(self):
self.revCount = self.s.scalar(self.cardLimit( self.revCount = self.s.scalar(self.cardLimit(
self.activeCramTags, self.activeCramTags, "",
"select count(*) from cards c where type between 0 and 2")) "select count(*) from cards c where type between 0 and 2"))
def _rebuildFailedCramCount(self): def _rebuildFailedCramCount(self):