mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
make sure cards are tagged correctly when importing tags
This commit is contained in:
parent
19698d6256
commit
e9e5994248
1 changed files with 2 additions and 2 deletions
|
@ -128,7 +128,7 @@ all but one card template."""))
|
||||||
try:
|
try:
|
||||||
idx = self.mapping.index(0)
|
idx = self.mapping.index(0)
|
||||||
for c in cards:
|
for c in cards:
|
||||||
c.tags = c.fields[idx]
|
c.tags += " " + c.fields[idx]
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
# add facts
|
# add facts
|
||||||
|
@ -136,7 +136,7 @@ all but one card template."""))
|
||||||
factIds = [genID() for n in range(len(cards))]
|
factIds = [genID() for n in range(len(cards))]
|
||||||
self.deck.s.execute(factsTable.insert(),
|
self.deck.s.execute(factsTable.insert(),
|
||||||
[{'modelId': self.model.id,
|
[{'modelId': self.model.id,
|
||||||
'tags': canonifyTags(self.tagsToAdd + "," + cards[n].tags),
|
'tags': canonifyTags(self.tagsToAdd + " " + cards[n].tags),
|
||||||
'id': factIds[n]} for n in range(len(cards))])
|
'id': factIds[n]} for n in range(len(cards))])
|
||||||
self.deck.factCount += len(factIds)
|
self.deck.factCount += len(factIds)
|
||||||
self.deck.s.execute("""
|
self.deck.s.execute("""
|
||||||
|
|
Loading…
Reference in a new issue