diff options
Diffstat (limited to 'module/remote/thriftbackend/Handler.py')
-rw-r--r-- | module/remote/thriftbackend/Handler.py | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/module/remote/thriftbackend/Handler.py b/module/remote/thriftbackend/Handler.py index 51764a0f5..1a9625394 100644 --- a/module/remote/thriftbackend/Handler.py +++ b/module/remote/thriftbackend/Handler.py @@ -137,7 +137,7 @@ class Handler(Iface): if not isinstance(pyfile, PyFile): continue status = DownloadInfo() - status.id = pyfile.id + status.fid = pyfile.id status.name = pyfile.name status.speed = pyfile.getSpeed() #bytes status.eta = pyfile.getETA() @@ -220,8 +220,7 @@ class Handler(Iface): def getQueue(self): packs = self.serverMethods.get_queue() ret = [] - for pid in packs: - pack = self.serverMethods.get_package_data(pid) + for pid, pack in packs.iteritems(): pdata = PackageInfo() pdata.pid = pack["id"] pdata.name = pack["name"] @@ -235,11 +234,27 @@ class Handler(Iface): ret.append(pdata) return ret - def getCollector(self): + def getQueueData(self): packs = self.serverMethods.get_queue() ret = [] - for pid in packs: - pack = self.serverMethods.get_package_data(pid) + for pid, pack in packs.iteritems(): + pdata = PackageData() + pdata.pid = pack["id"] + pdata.name = pack["name"] + pdata.folder = pack["folder"] + pdata.site = pack["site"] + pdata.password = pack["password"] + pdata.dest = pack["queue"] + pdata.order = pack["order"] + pdata.priority = pack["priority"] + pdata.links = [self._convertPyFile(x) for x in pack["links"].values()] + ret.append(pdata) + return ret + + def getCollector(self): + packs = self.serverMethods.get_collector() + ret = [] + for pid, pack in packs.iteritems(): pdata = PackageInfo() pdata.pid = pack["id"] pdata.name = pack["name"] @@ -249,6 +264,23 @@ class Handler(Iface): pdata.dest = pack["queue"] pdata.order = pack["order"] pdata.priority = pack["priority"] + pdata.links = [self._convertPyFile(x) for x in pack["links"].values()] + ret.append(pdata) + return ret + + def getCollectorData(self): + packs = self.serverMethods.get_collector() + ret = [] + for pid, pack in packs.iteritems(): + pdata = PackageData() + pdata.pid = pack["id"] + pdata.name = pack["name"] + pdata.folder = pack["folder"] + pdata.site = pack["site"] + pdata.password = pack["password"] + pdata.dest = pack["queue"] + pdata.order = pack["order"] + pdata.priority = pack["priority"] pdata.links = [int(x) for x in pack["links"].keys()] ret.append(pdata) return ret |