mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 06:07:11 -05:00
find and cards with invalid dids on deck list
This commit is contained in:
parent
e644cc1faa
commit
faa3c7134b
2 changed files with 8 additions and 0 deletions
|
|
@ -368,6 +368,13 @@ class DeckManager(object):
|
|||
return self.col.db.list("select id from cards where did in "+
|
||||
ids2str(dids))
|
||||
|
||||
def recoverOrphans(self):
|
||||
dids = self.decks.keys()
|
||||
mod = self.col.db.mod
|
||||
self.col.db.execute("update cards set did = 1 where did not in "+
|
||||
ids2str(dids))
|
||||
self.col.db.mod = mod
|
||||
|
||||
# Deck selection
|
||||
#############################################################
|
||||
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ order by due""" % self._deckLimit(),
|
|||
self._checkDay()
|
||||
if self._clearOverdue:
|
||||
self.removeFailed(expiredOnly=True)
|
||||
self.col.decks.recoverOrphans()
|
||||
decks = self.col.decks.all()
|
||||
decks.sort(key=itemgetter('name'))
|
||||
lims = {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue