mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
work around usn upgrade issue
This commit is contained in:
parent
8aa23c7156
commit
ea57f32939
1 changed files with 10 additions and 1 deletions
11
anki/sync.py
11
anki/sync.py
|
@ -185,8 +185,17 @@ select count() from notes where id not in (select distinct nid from cards)""")
|
||||||
assert g['usn'] != -1
|
assert g['usn'] != -1
|
||||||
for t, usn in self.col.tags.allItems():
|
for t, usn in self.col.tags.allItems():
|
||||||
assert usn != -1
|
assert usn != -1
|
||||||
|
found = False
|
||||||
for m in self.col.models.all():
|
for m in self.col.models.all():
|
||||||
assert m['usn'] != -1
|
if self.col.server:
|
||||||
|
# the web upgrade was mistakenly setting usn
|
||||||
|
if m['usn'] < 0:
|
||||||
|
m['usn'] = 0
|
||||||
|
found = True
|
||||||
|
else:
|
||||||
|
assert m['usn'] != -1
|
||||||
|
if found:
|
||||||
|
self.col.models.save()
|
||||||
self.col.sched.reset()
|
self.col.sched.reset()
|
||||||
# check for missing parent decks
|
# check for missing parent decks
|
||||||
self.col.sched.deckDueList()
|
self.col.sched.deckDueList()
|
||||||
|
|
Loading…
Reference in a new issue