diff options
| author | 2011-07-08 12:10:22 +0200 | |
|---|---|---|
| committer | 2011-07-08 12:10:22 +0200 | |
| commit | d5034d4f8929221f021b61a82e893cb5d53c3676 (patch) | |
| tree | 5ddf19b63077a39f069b3b642f55647fdcc90f20 /module/Api.py | |
| parent | basic event manager (diff) | |
| download | pyload-d5034d4f8929221f021b61a82e893cb5d53c3676.tar.xz | |
calculate queue count, db improvements
Diffstat (limited to 'module/Api.py')
| -rw-r--r-- | module/Api.py | 13 | 
1 files changed, 5 insertions, 8 deletions
| diff --git a/module/Api.py b/module/Api.py index 832122ac5..15052e83a 100644 --- a/module/Api.py +++ b/module/Api.py @@ -141,17 +141,14 @@ class Api(Iface):          :return: `ServerStatus`          """ -        serverStatus = ServerStatus() -        serverStatus.pause = self.core.threadManager.pause -        serverStatus.active = len(self.core.threadManager.processingIds()) -        serverStatus.queue = self.core.files.getFileCount() #TODO: real amount of queued files -        serverStatus.total = self.core.files.getFileCount() -        serverStatus.speed = 0 +        serverStatus = ServerStatus(self.core.threadManager.pause, len(self.core.threadManager.processingIds()), +                                    self.core.files.getQueueCount(), self.core.files.getFileCount(), 0, +                                    not self.core.threadManager.pause and self.isTimeDownload(), +                                    self.core.config['reconnect']['activated'] and self.isTimeReconnect()) +          for pyfile in [x.active for x in self.core.threadManager.threads if x.active and isinstance(x, PyFile)]:              serverStatus.speed += pyfile.getSpeed() #bytes/s -        serverStatus.download = not self.core.threadManager.pause and self.isTimeDownload() -        serverStatus.reconnect = self.core.config['reconnect']['activated'] and self.isTimeReconnect()          return serverStatus      def freeSpace(self): | 
