summaryrefslogtreecommitdiffstats
path: root/module/network
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-05-26 15:47:08 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-05-26 15:47:08 +0200
commitf7b955fa6ddb427d5c96120114cb7a333f8b2fa1 (patch)
tree5f74b0d3886b8ac24fabf22a2161d08a553b5200 /module/network
parentintroduced logger (diff)
downloadpyload-f7b955fa6ddb427d5c96120114cb7a333f8b2fa1.tar.xz
little request fix
Diffstat (limited to 'module/network')
-rwxr-xr-xmodule/network/Request.py5
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"