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 = {}
dids = {}
dues = {}
for id, nid, ord, did, due, odue, odid in self.db.execute(
"select id, nid, ord, did, due, odue, odid from cards where nid in "+snids):
for id, nid, ord, did, due, odue, odid, type in self.db.execute(
"select id, nid, ord, did, due, odue, odid, type from cards where nid in "+snids):
# existing cards
if nid not in have:
have[nid] = {}
@ -375,7 +375,8 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
# save due
if odid != 0:
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
# build cards for each note
data = []