From 874507efecc459613c69560a68437f0f22374aca Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 26 Jun 2022 10:55:50 +0530 Subject: [PATCH] Fix incorrect counting on initial done event for time estimation --- src/calibre/gui2/fts/scan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/fts/scan.py b/src/calibre/gui2/fts/scan.py index 9b6314f730..54bf69bfc3 100644 --- a/src/calibre/gui2/fts/scan.py +++ b/src/calibre/gui2/fts/scan.py @@ -35,7 +35,7 @@ class IndexingProgress: changed = (left, total) != (self.left, self.total) if changed: done_num = self.left - left - if done_num: + if done_num > 0 and self.left > -1: # initial event will have self.left == -1 self.done_events.append((done_num, time.monotonic())) if len(self.done_events) > 50: self.done_events.popleft()