diff --git a/qt/aqt/sound.py b/qt/aqt/sound.py index fd0f9a130..08f5c206f 100644 --- a/qt/aqt/sound.py +++ b/qt/aqt/sound.py @@ -337,7 +337,8 @@ class MpvManager(MPV, SoundOrVideoPlayer): def on_init(self) -> None: # if mpv dies and is restarted, tell Anki the # current file is done - self.on_end_file() + if self._on_done: + self._on_done() try: self.command("keybind", "q", "stop") @@ -364,8 +365,8 @@ class MpvManager(MPV, SoundOrVideoPlayer): def seek_relative(self, secs: int) -> None: self.command("seek", secs, "relative") - def on_end_file(self) -> None: - if self._on_done: + def on_property_idle_active(self, value: bool) -> None: + if value and self._on_done: self._on_done() def shutdown(self) -> None: