mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
unbury on open/close and make sure we set usn when unburying
This commit is contained in:
parent
492ed33f4d
commit
0bef1d8530
2 changed files with 8 additions and 2 deletions
|
@ -58,7 +58,9 @@ class _Collection(object):
|
||||||
self.crt = int(time.mktime(d.timetuple()))
|
self.crt = int(time.mktime(d.timetuple()))
|
||||||
self.sched = Scheduler(self)
|
self.sched = Scheduler(self)
|
||||||
if not self.conf.get("newBury", False):
|
if not self.conf.get("newBury", False):
|
||||||
|
mod = self.db.mod
|
||||||
self.sched.unburyCards()
|
self.sched.unburyCards()
|
||||||
|
self.db.mod = mod
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
n = os.path.splitext(os.path.basename(self.path))[0]
|
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):
|
def close(self, save=True):
|
||||||
"Disconnect from DB."
|
"Disconnect from DB."
|
||||||
if self.db:
|
if self.db:
|
||||||
|
if not self.conf.get("newBury", False):
|
||||||
|
mod = self.db.mod
|
||||||
|
self.sched.unburyCards()
|
||||||
|
self.db.mod = mod
|
||||||
if save:
|
if save:
|
||||||
self.save()
|
self.save()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -135,9 +135,9 @@ order by due""" % self._deckLimit(),
|
||||||
def unburyCards(self):
|
def unburyCards(self):
|
||||||
"Unbury cards."
|
"Unbury cards."
|
||||||
self.col.conf['lastUnburied'] = self.today
|
self.col.conf['lastUnburied'] = self.today
|
||||||
self.col.setMod()
|
|
||||||
self.col.db.execute(
|
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
|
# Rev/lrn/time daily stats
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
Loading…
Reference in a new issue