diff --git a/src/lib/review_hook.py b/src/lib/review_hook.py index 3a0f198..b0e03d9 100644 --- a/src/lib/review_hook.py +++ b/src/lib/review_hook.py @@ -31,7 +31,7 @@ def check_for_straight_reward(_reviewer, card, answer: Answer): easeplus = maybe_apply_reward(sett, straightlen, card) - if easeplus: + if easeplus > 0: latest_info[card.id] = easeplus if sett.enable_notifications: diff --git a/src/lib/sync_hook.py b/src/lib/sync_hook.py index d9ede81..92582d1 100644 --- a/src/lib/sync_hook.py +++ b/src/lib/sync_hook.py @@ -85,7 +85,7 @@ def after_sync(col) -> None: result = check_cids(col, newrev_cids) - filtered_logs = [f"cid:{r[0]} easeplus:{r[1]}" for r in result if r[1] != 0] + filtered_logs = [f"cid:{r[0]} easeplus:{r[1]}" for r in result if r[1] > 0] filtered_length = len(filtered_logs) if filtered_length > 0: diff --git a/src/utils.py b/src/utils.py index 8367355..b2737e3 100644 --- a/src/utils.py +++ b/src/utils.py @@ -72,7 +72,7 @@ def apply_ease_change(card, reward: int, sett_min: int, sett_max: int): else: return 0 -def maybe_apply_reward(sett, straightlen, card) -> Optional[Tuple[int, int]]: +def maybe_apply_reward(sett, straightlen, card) -> int: if ( sett.straight_length >= 1 and straightlen >= sett.straight_length @@ -87,4 +87,4 @@ def maybe_apply_reward(sett, straightlen, card) -> Optional[Tuple[int, int]]: # easeplus of 0 will react similiar to None return easeplus - return None + return 0