unbury on open/close and make sure we set usn when unburying
This commit is contained in:
parent
492ed33f4d
commit
0bef1d8530
@ -58,7 +58,9 @@ class _Collection(object):
|
||||
self.crt = int(time.mktime(d.timetuple()))
|
||||
self.sched = Scheduler(self)
|
||||
if not self.conf.get("newBury", False):
|
||||
mod = self.db.mod
|
||||
self.sched.unburyCards()
|
||||
self.db.mod = mod
|
||||
|
||||
def name(self):
|
||||
n = os.path.splitext(os.path.basename(self.path))[0]
|
||||
@ -131,6 +133,10 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
|
||||
def close(self, save=True):
|
||||
"Disconnect from DB."
|
||||
if self.db:
|
||||
if not self.conf.get("newBury", False):
|
||||
mod = self.db.mod
|
||||
self.sched.unburyCards()
|
||||
self.db.mod = mod
|
||||
if save:
|
||||
self.save()
|
||||
else:
|
||||
|
@ -135,9 +135,9 @@ order by due""" % self._deckLimit(),
|
||||
def unburyCards(self):
|
||||
"Unbury cards."
|
||||
self.col.conf['lastUnburied'] = self.today
|
||||
self.col.setMod()
|
||||
self.col.db.execute(
|
||||
"update cards set queue = type where queue = -2")
|
||||
"update cards set mod=?,usn=?,queue=type where queue = -2",
|
||||
intTime(), self.col.usn())
|
||||
|
||||
# Rev/lrn/time daily stats
|
||||
##########################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user