fix media check not updating progress

This commit is contained in:
Damien Elmes 2021-02-08 16:46:57 +10:00
parent 6ac35b30c1
commit 4ac62f8848

View File

@ -58,9 +58,15 @@ class MediaChecker:
self._progress_timer.stop() self._progress_timer.stop()
self._progress_timer = None self._progress_timer = None
if enabled: if enabled:
self._progress_timer = self.mw.progress.timer(100, self._on_progress, True) self._progress_timer = timer = QTimer()
timer.setSingleShot(False)
timer.setInterval(100)
qconnect(timer.timeout, self._on_progress)
timer.start()
def _on_progress(self) -> None: def _on_progress(self) -> None:
if not self.mw.col:
return
progress = self.mw.col.latest_progress() progress = self.mw.col.latest_progress()
if not progress.HasField("media_check"): if not progress.HasField("media_check"):
return return