mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
fix upgrade code
This commit is contained in:
parent
9b4da171fe
commit
fa1713e9ee
1 changed files with 13 additions and 6 deletions
19
anki/deck.py
19
anki/deck.py
|
@ -2495,18 +2495,25 @@ where interval < 1""")
|
|||
for (id, tags) in rows:
|
||||
d.append({
|
||||
'i': id,
|
||||
't': joinTags(
|
||||
't': joinTags(sorted(
|
||||
[t.strip().replace(" ", "-") for t in
|
||||
tags.split(",") if t.strip()]),
|
||||
'tt': time.time(),
|
||||
tags.split(",") if t.strip()])),
|
||||
})
|
||||
deck.s.statements(
|
||||
"update facts set tags = :t, modified = :tt where id = :i", d)
|
||||
"update facts set tags = :t where id = :i", d)
|
||||
deck.highPriority = deck.highPriority.replace(" ", "-")
|
||||
deck.medPriority = deck.medPriority.replace(" ", "-")
|
||||
deck.lowPriority = deck.lowPriority.replace(" ", "-")
|
||||
deck.suspended = deck.suspended.replace(" ", "-")
|
||||
deck.highPriority = deck.highPriority.replace(",", " ")
|
||||
deck.medPriority = deck.medPriority.replace(",", " ")
|
||||
deck.lowPriority = deck.lowPriority.replace(",", " ")
|
||||
deck.suspended = deck.suspended.replace(",", " ")
|
||||
for m in deck.models:
|
||||
for cm in m.cardModels:
|
||||
cm.name = cm.name.replace(" ", "-")
|
||||
m.tags = m.tags.replace(" ", "-")
|
||||
m.setModified()
|
||||
m.tags = re.sub(", ?", " ", m.tags)
|
||||
m.tags = canonifyTags(m.tags)
|
||||
deck.updateCardsFromModel(m, dirty=False)
|
||||
deck.version = 26
|
||||
deck.s.commit()
|
||||
|
|
Loading…
Reference in a new issue