fix bug where nondue review cards in cram were treated as due

This commit is contained in:
Damien Elmes 2012-05-06 01:44:10 +09:00
parent 782dd53d16
commit c2370fe3ef

View file

@ -809,9 +809,12 @@ order by c.mod""" % ((self.dayCutoff-86400)*1000)
# everything in the new queue # everything in the new queue
queue = "0" queue = "0"
else: else:
# due reviews stay in the review queue # due reviews stay in the review queue. careful: can't use
queue = "(case when type=2 and (odue or due) <= %d then 2 else 0 end)" # "odid or did", as sqlite converts to boolean
queue %= self.today queue = """
(case when type=2 and (case when odue then odue <= %d else due <= %d end)
then 2 else 0 end)"""
queue %= (self.today, self.today)
self.col.db.executemany(""" self.col.db.executemany("""
update cards set update cards set
odid = (case when odid then odid else did end), odid = (case when odid then odid else did end),