diff --git a/qt/aqt/mediacheck.py b/qt/aqt/mediacheck.py index c95f2a953..5102c8ba9 100644 --- a/qt/aqt/mediacheck.py +++ b/qt/aqt/mediacheck.py @@ -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 diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index c6b68d8df..df9d26cf1 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -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(