summaryrefslogtreecommitdiffstats
path: root/module/datatypes/PyFile.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-20 21:39:30 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-20 21:39:30 +0100
commit63cef4c7d641ffddaeabcd768020674e2681ba05 (patch)
tree10b9ee50b927a7673d93db15b896a15a1012f482 /module/datatypes/PyFile.py
parentadded ReadWrite lock, render file progress on dashboard (diff)
downloadpyload-63cef4c7d641ffddaeabcd768020674e2681ba05.tar.xz
improved ui, render waiting files
Diffstat (limited to 'module/datatypes/PyFile.py')
-rw-r--r--module/datatypes/PyFile.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/module/datatypes/PyFile.py b/module/datatypes/PyFile.py
index bd335a05a..5f2be8769 100644
--- a/module/datatypes/PyFile.py
+++ b/module/datatypes/PyFile.py
@@ -16,7 +16,7 @@
# @author: RaNaN
###############################################################################
-from time import sleep
+from time import sleep, time
from ReadWriteLock import ReadWriteLock
from module.Api import ProgressInfo, DownloadProgress, FileInfo, DownloadInfo, DownloadStatus
@@ -229,8 +229,11 @@ class PyFile(object):
return 0
def getETA(self):
- """ gets established time of arrival"""
+ """ gets established time of arrival / or waiting time"""
try:
+ if self.status == DownloadStatus.Waiting:
+ return self.waitUntil - time()
+
return self.getBytesLeft() / self.getSpeed()
except:
return 0