mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
catch missing facts at end of sync
This commit is contained in:
parent
1f239c1e67
commit
99ba3f09c8
1 changed files with 6 additions and 0 deletions
|
@ -206,6 +206,12 @@ class SyncTools(object):
|
|||
self.rebuildPriorities(cardIds)
|
||||
# rebuild due counts
|
||||
self.deck.rebuildCounts(full=False)
|
||||
assert self.missingFacts() == 0
|
||||
|
||||
def missingFacts(self):
|
||||
return self.deck.s.scalar(
|
||||
"select count() from cards where factId "+
|
||||
"not in (select id from facts)");
|
||||
|
||||
def rebuildPriorities(self, cardIds, suspend=[]):
|
||||
self.deck.updateAllPriorities(partial=True, dirty=False)
|
||||
|
|
Loading…
Reference in a new issue