From d70d5a65218c3d16a6f2629ab6ce2720f55cf380 Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 2 Oct 2021 19:00:09 +0200 Subject: [PATCH] [downloader] Fix ETA calculation for runtimes >= 1 hour Closes #345 --- legendary/downloader/mp/manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/legendary/downloader/mp/manager.py b/legendary/downloader/mp/manager.py index 846d8c5..0bc501a 100644 --- a/legendary/downloader/mp/manager.py +++ b/legendary/downloader/mp/manager.py @@ -685,13 +685,13 @@ class DLManager(Process): total_used = (num_shared_memory_segments - total_avail) * (self.analysis.biggest_chunk / 1024 / 1024) if runtime and processed_chunks: - rt_hours, runtime = int(runtime // 3600), runtime % 3600 - rt_minutes, rt_seconds = int(runtime // 60), int(runtime % 60) - average_speed = processed_chunks / runtime estimate = (num_chunk_tasks - processed_chunks) / average_speed hours, estimate = int(estimate // 3600), estimate % 3600 minutes, seconds = int(estimate // 60), int(estimate % 60) + + rt_hours, runtime = int(runtime // 3600), runtime % 3600 + rt_minutes, rt_seconds = int(runtime // 60), int(runtime % 60) else: hours = minutes = seconds = 0 rt_hours = rt_minutes = rt_seconds = 0