Skip to content

Commit

Permalink
Remove legacy version checks and simplify code (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock authored Jan 9, 2025
1 parent e822029 commit 2accaaf
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import random
import time
from datetime import date, datetime, timedelta
from anki.utils import int_version


FSRS_ENABLE_WARNING = (
Expand Down Expand Up @@ -53,10 +52,7 @@ def reset_ivl_and_due(cid: int, revlogs: List[CardStatsResponse.StatsRevlogEntry


def get_revlogs(cid: int):
if int_version() >= 241000:
return mw.col.get_review_logs(cid)
else:
return mw.col.card_stats_data(cid).revlog
return mw.col.get_review_logs(cid)


def filter_revlogs(
Expand Down Expand Up @@ -165,10 +161,7 @@ def sched_current_date() -> date:
return (now - timedelta(hours=next_day_start_at)).date()


if int_version() < 231200:
DECAY = -1
else:
DECAY = -0.5 # FSRS-4.5
DECAY = -0.5
FACTOR = 0.9 ** (1 / DECAY) - 1


Expand Down

0 comments on commit 2accaaf

Please sign in to comment.