From b60c83bfd58fc2f2c8c51a7c6648be2a44d5bcf2 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 9 Feb 2021 17:54:35 -0600 Subject: [PATCH] Don't trust 100% to count jobs finished. --- calibre-plugin/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calibre-plugin/jobs.py b/calibre-plugin/jobs.py index 9df5a30a..ff73761d 100644 --- a/calibre-plugin/jobs.py +++ b/calibre-plugin/jobs.py @@ -98,7 +98,7 @@ def do_download_worker(book_list, (percent,msg) = job.notifications.get_nowait() logger.debug("%s<-%s"%(percent,msg)) totals[msg] = percent/len(totals) - if percent == 1.0: + if job.is_finished: count += 1 notification(max(0.01,sum(totals.values())), _('%(count)d of %(total)d stories finished downloading')%{'count':count,'total':len(totals)}) except Empty: