Adding new cloze while in filtered deck
When adding a new cloze tag while a card is in a filtered deck, anki currently adds the new card to the Default deck. My proposed fix checks if the card has the odid field set and then sets the did to use when generating the new cards as the odid.
This commit is contained in:
parent
d71ca63b4c
commit
610ca050eb
@ -304,12 +304,15 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
|
|||||||
snids = ids2str(nids)
|
snids = ids2str(nids)
|
||||||
have = {}
|
have = {}
|
||||||
dids = {}
|
dids = {}
|
||||||
for id, nid, ord, did in self.db.execute(
|
for id, nid, ord, did, odid in self.db.execute(
|
||||||
"select id, nid, ord, did from cards where nid in "+snids):
|
"select id, nid, ord, did, odid from cards where nid in "+snids):
|
||||||
# existing cards
|
# existing cards
|
||||||
if nid not in have:
|
if nid not in have:
|
||||||
have[nid] = {}
|
have[nid] = {}
|
||||||
have[nid][ord] = id
|
have[nid][ord] = id
|
||||||
|
# if in a filtered deck, add new cards to original deck
|
||||||
|
if odid != 0:
|
||||||
|
did = odid
|
||||||
# and their dids
|
# and their dids
|
||||||
if nid in dids:
|
if nid in dids:
|
||||||
if dids[nid] and dids[nid] != did:
|
if dids[nid] and dids[nid] != did:
|
||||||
|
Loading…
Reference in New Issue
Block a user