def flush(self) -> None: self.mod = intTime() self.usn = self.col.usn() # bug check if self.queue == 2 and self.odue and not self.col.decks.isDyn( self.did): hooks.card_odue_was_invalid() assert self.due < 4294967296 self.col.db.execute( """ insert or replace into cards values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""", self.id, self.nid, self.did, self.ord, self.mod, self.usn, self.type, self.queue, self.due, self.ivl, self.factor, self.reps, self.lapses, self.left, self.odue, self.odid, self.flags, self.data, ) self.col.log(self)
def _bugcheck(self) -> None: if ( self.queue == QUEUE_TYPE_REV and self.odue and not self.col.decks.isDyn(self.did) ): hooks.card_odue_was_invalid()
def flushSched(self) -> None: self.mod = intTime() self.usn = self.col.usn() # bug checks if self.queue == 2 and self.odue and not self.col.decks.isDyn( self.did): hooks.card_odue_was_invalid() assert self.due < 4294967296 self.col.db.execute( """update cards set mod=?, usn=?, type=?, queue=?, due=?, ivl=?, factor=?, reps=?, lapses=?, left=?, odue=?, odid=?, did=? where id = ?""", self.mod, self.usn, self.type, self.queue, self.due, self.ivl, self.factor, self.reps, self.lapses, self.left, self.odue, self.odid, self.did, self.id, ) self.col.log(self)
def _preFlush(self) -> None: hooks.card_will_flush(self) self.mod = intTime() self.usn = self.col.usn() # bug check if (self.queue == QUEUE_TYPE_REV and self.odue and not self.col.decks.isDyn(self.did)): hooks.card_odue_was_invalid() assert self.due < 4294967296