mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Add the media_check_did_finish hook (#1889)
This commit is contained in:
parent
96bacf792c
commit
5fe9447dcc
2 changed files with 9 additions and 0 deletions
|
@ -13,6 +13,7 @@ import aqt.progress
|
|||
from anki.collection import Collection, SearchNode
|
||||
from anki.errors import Interrupted
|
||||
from anki.media import CheckMediaResponse
|
||||
from aqt import gui_hooks
|
||||
from aqt.operations import QueryOp
|
||||
from aqt.qt import *
|
||||
from aqt.utils import (
|
||||
|
@ -96,6 +97,7 @@ class MediaChecker:
|
|||
return
|
||||
|
||||
output: CheckMediaResponse = future.result()
|
||||
gui_hooks.media_check_did_finish(output)
|
||||
report = output.report
|
||||
|
||||
# show report and offer to delete
|
||||
|
|
|
@ -762,6 +762,13 @@ gui_hooks.webview_did_inject_style_into_page.append(mytest)
|
|||
Note that the media sync did not necessarily finish at this point.""",
|
||||
),
|
||||
Hook(name="media_check_will_start", args=[]),
|
||||
Hook(
|
||||
name="media_check_did_finish",
|
||||
args=["output: anki.media.CheckMediaResponse"],
|
||||
doc="""Called after Media Check finishes.
|
||||
|
||||
`output` provides access to the unused/missing file lists and the text output that will be shown in the Check Media screen.""",
|
||||
),
|
||||
# Dialog Manager
|
||||
###################
|
||||
Hook(
|
||||
|
|
Loading…
Reference in a new issue