LEECH_SUSPEND

This commit is contained in:
Arthur Milchior 2020-01-30 17:03:51 -08:00
parent 72f8ae7b33
commit dadf9042f7
4 changed files with 4 additions and 3 deletions

View file

@ -60,6 +60,7 @@ SYNC_VER = 9
HELP_SITE = "http://ankisrs.net/docs/manual.html" HELP_SITE = "http://ankisrs.net/docs/manual.html"
# Leech actions # Leech actions
LEECH_SUSPEND = 0
# Labels # Labels
########################################################################## ##########################################################################

View file

@ -71,7 +71,7 @@ defaultConf = {
"minInt": 1, "minInt": 1,
"leechFails": 8, "leechFails": 8,
# type 0=suspend, 1=tagonly # type 0=suspend, 1=tagonly
"leechAction": 0, "leechAction": LEECH_SUSPEND,
}, },
"rev": { "rev": {
"perDay": 200, "perDay": 200,

View file

@ -1145,7 +1145,7 @@ did = ?, queue = %s, due = ?, usn = ? where id = ?"""
f.flush() f.flush()
# handle # handle
a = conf["leechAction"] a = conf["leechAction"]
if a == 0: if a == LEECH_SUSPEND:
# if it has an old due, remove it from cram/relearning # if it has an old due, remove it from cram/relearning
if card.odue: if card.odue:
card.due = card.odue card.due = card.odue

View file

@ -1284,7 +1284,7 @@ where id = ?
f.flush() f.flush()
# handle # handle
a = conf["leechAction"] a = conf["leechAction"]
if a == 0: if a == LEECH_SUSPEND:
card.queue = -1 card.queue = -1
# notify UI # notify UI
hooks.card_did_leech(card) hooks.card_did_leech(card)