mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 07:07:13 -05:00
Revert "make importing with an explicit deck work again"
This reverts commit f177083bcb.
This commit is contained in:
parent
f177083bcb
commit
e41c7738d3
1 changed files with 1 additions and 11 deletions
|
|
@ -100,7 +100,6 @@ class NoteImporter(Importer):
|
||||||
new = []
|
new = []
|
||||||
self._ids = []
|
self._ids = []
|
||||||
self._cards = []
|
self._cards = []
|
||||||
self._cdecks = []
|
|
||||||
for n in notes:
|
for n in notes:
|
||||||
fld0 = n.fields[fld0idx]
|
fld0 = n.fields[fld0idx]
|
||||||
csum = fieldChecksum(fld0)
|
csum = fieldChecksum(fld0)
|
||||||
|
|
@ -141,9 +140,8 @@ class NoteImporter(Importer):
|
||||||
self.col.updateFieldCache(self._ids)
|
self.col.updateFieldCache(self._ids)
|
||||||
# generate cards
|
# generate cards
|
||||||
assert not self.col.genCards(self._ids)
|
assert not self.col.genCards(self._ids)
|
||||||
# apply scheduling updates and decks
|
# apply scheduling updates
|
||||||
self.updateCards()
|
self.updateCards()
|
||||||
self.updateDecks()
|
|
||||||
# make sure to update sflds, etc
|
# make sure to update sflds, etc
|
||||||
self.total = len(self._ids)
|
self.total = len(self._ids)
|
||||||
|
|
||||||
|
|
@ -157,10 +155,6 @@ class NoteImporter(Importer):
|
||||||
# note id for card updates later
|
# note id for card updates later
|
||||||
for ord, c in n.cards.items():
|
for ord, c in n.cards.items():
|
||||||
self._cards.append((id, ord, c))
|
self._cards.append((id, ord, c))
|
||||||
# did they override the default deck?
|
|
||||||
if n.deck:
|
|
||||||
did = self.col.decks.id(n.deck)
|
|
||||||
self._cdecks.append((did, id))
|
|
||||||
self.col.tags.register(n.tags)
|
self.col.tags.register(n.tags)
|
||||||
return [id, guid64(), self.model['id'],
|
return [id, guid64(), self.model['id'],
|
||||||
intTime(), self.col.usn(), self.col.tags.join(n.tags),
|
intTime(), self.col.usn(), self.col.tags.join(n.tags),
|
||||||
|
|
@ -210,7 +204,3 @@ where id = ? and (flds != ? or tags != ?)""", rows)
|
||||||
self.col.db.executemany("""
|
self.col.db.executemany("""
|
||||||
update cards set type = 2, queue = 2, ivl = ?, due = ?,
|
update cards set type = 2, queue = 2, ivl = ?, due = ?,
|
||||||
factor = ?, reps = ?, lapses = ? where nid = ? and ord = ?""", data)
|
factor = ?, reps = ?, lapses = ? where nid = ? and ord = ?""", data)
|
||||||
|
|
||||||
def updateDecks(self):
|
|
||||||
self.col.db.executemany(
|
|
||||||
"update cards set did = ? where nid = ?", self._cdecks)
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue