Merge pull request #339 from Arthur-Milchior/correctDueOfNewSiblings

New cards of existing note take due value of NEW siblings
This commit is contained in:
Damien Elmes 2019-10-20 08:22:15 +10:00 committed by GitHub
commit c2a6c3e47a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -354,8 +354,8 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
have = {} have = {}
dids = {} dids = {}
dues = {} dues = {}
for id, nid, ord, did, due, odue, odid in self.db.execute( for id, nid, ord, did, due, odue, odid, type in self.db.execute(
"select id, nid, ord, did, due, odue, odid from cards where nid in "+snids): "select id, nid, ord, did, due, odue, odid, type from cards where nid in "+snids):
# existing cards # existing cards
if nid not in have: if nid not in have:
have[nid] = {} have[nid] = {}
@ -375,7 +375,8 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
# save due # save due
if odid != 0: if odid != 0:
due = odue due = odue
if nid not in dues: if nid not in dues and type == 0:
# Add due to new card only if it's the due of a new sibling
dues[nid] = due dues[nid] = due
# build cards for each note # build cards for each note
data = [] data = []