From 0b1a135176be9100ebfd62474710733b74bbc6df Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 20 Feb 2009 00:12:19 +0900 Subject: [PATCH] update card tags after sync, new priority handling --- anki/sync.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/anki/sync.py b/anki/sync.py index 201bc3a0e..81c4bca80 100644 --- a/anki/sync.py +++ b/anki/sync.py @@ -131,6 +131,7 @@ class SyncTools(object): self.postSyncRefresh() # rebuild priorities on server cardIds = [x[0] for x in payload['added-cards']] + self.deck.updateCardTags(cardIds) self.rebuildPriorities(cardIds, self.serverExcludedTags) # rebuild due counts self.deck.rebuildCounts(full=False) @@ -150,14 +151,13 @@ class SyncTools(object): self.postSyncRefresh() # rebuild priorities on client cardIds = [x[0] for x in reply['added-cards']] + self.deck.updateCardTags(cardIds) self.rebuildPriorities(cardIds) # rebuild due counts self.deck.rebuildCounts(full=False) - def rebuildPriorities(self, cardIds, extraExcludes=[]): - where = "and cards.id in %s" % ids2str(cardIds) - self.deck.updateAllPriorities(extraExcludes=extraExcludes, - where=where) + def rebuildPriorities(self, cardIds, suspend=[]): + self.deck.updatePriorities(cardIds, suspend=suspend) def postSyncRefresh(self): "Flush changes to DB, and reload object associations."