diff options
Diffstat (limited to 'module/network/Request.py')
-rwxr-xr-x | module/network/Request.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/module/network/Request.py b/module/network/Request.py index 510f6d069..1b94ed13f 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -105,17 +105,18 @@ class Request: file.write(chunk) file.close() self.dl = False + self.dl_finished = time.time() return True def get_speed(self): try: - return (self.dl_arrived / (time.time() - self.dl_time)) / 1024 + return (self.dl_arrived / ((time.time() if self.dl else self.dl_finished) - self.dl_time )) / 1024 except: return "No Download" def get_ETA(self): try: - return (self.dl_size - self.dl_arrived) / (self.dl_arrived / (time.time() - self.dl_time if self.dl else self.dl_finished)) + return (self.dl_size - self.dl_arrived) / (self.dl_arrived / (time.time() - self.dl_time)) except: return "No Download" |