Skip to content

Commit

Permalink
Merge pull request #33 from yibe/66-typeerror
Browse files Browse the repository at this point in the history
Fix error on Anki 2.1.66 (fixes #32)
  • Loading branch information
hgiesel committed Aug 28, 2023
2 parents 3fe7225 + d9eabd1 commit db9c141
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/review_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from anki.consts import CARD_TYPE_REV, REVLOG_REV
from anki.collection import Collection
from anki.cards import Card
from anki.scheduler.v3 import SetSchedulingStatesRequest

from .logic import (
get_straight_len,
Expand Down Expand Up @@ -67,7 +68,11 @@ def check_straight_reward(
else:
next_states.easy.normal.review.ease_factor += easeplus / 1000

reviewer.set_scheduling_states(reviewer._state_mutation_key, next_states)
request = SetSchedulingStatesRequest(
key=reviewer._state_mutation_key,
states=next_states,
)
reviewer.set_scheduling_states(request)
else:
gains[card.id] = easeplus

Expand Down

0 comments on commit db9c141

Please # to comment.