From ee58e651ef59f9831e9f864d11b35bcf947f523a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 20 Jan 2016 20:59:56 +1000 Subject: [PATCH] work around huge perDay values set by other clients sqlite was choking on the long values --- anki/decks.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/anki/decks.py b/anki/decks.py index a09194fab..ace66563d 100644 --- a/anki/decks.py +++ b/anki/decks.py @@ -93,7 +93,17 @@ class DeckManager(object): def load(self, decks, dconf): self.decks = json.loads(decks) self.dconf = json.loads(dconf) - self.changed = False + # set limits to within bounds + found = False + for c in self.dconf.values(): + for t in ('rev', 'new'): + pd = 'perDay' + if c[t][pd] > 999999: + c[t][pd] = 999999 + self.save(c) + found = True + if not found: + self.changed = False def save(self, g=None): "Can be called with either a deck or a deck configuration."