Skip to content

Commit 633988c

Browse files
committed
add hook for day rollover
1 parent 038d85b commit 633988c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

qt/aqt/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,8 @@ def refresh_reviewer_on_day_rollover_change():
554554
last_day_cutoff = self.col.sched.day_cutoff
555555
self.reviewer._refresh_needed = RefreshNeeded.QUEUES
556556
self.reviewer.refresh_if_needed()
557+
if last_day_cutoff != current_cutoff:
558+
gui_hooks.rollover()
557559

558560
# schedule another check
559561
secs_until_cutoff = current_cutoff - int_time()

qt/tools/genhooks_gui.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,10 @@ def on_top_toolbar_did_init_links(links, toolbar):
898898
899899
`output` provides access to the unused/missing file lists and the text output that will be shown in the Check Media screen.""",
900900
),
901+
Hook(
902+
name="rollover",
903+
doc="""Called when Anki moves to the next day."""
904+
),
901905
# Importing/exporting data
902906
###################
903907
Hook(

0 commit comments

Comments
 (0)