From 967d6dd16c25ceba22dcd105079f72534ddb87e9 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 26 Sep 2013 16:40:38 +0200 Subject: rewritten decrypter and info fetching thread --- pyload/api/DownloadPreparingApi.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'pyload/api') diff --git a/pyload/api/DownloadPreparingApi.py b/pyload/api/DownloadPreparingApi.py index 68c83e97d..131f73b1d 100644 --- a/pyload/api/DownloadPreparingApi.py +++ b/pyload/api/DownloadPreparingApi.py @@ -37,16 +37,16 @@ class DownloadPreparingApi(ApiComponent): def checkLinks(self, links): """ initiates online status check, will also decrypt files. - :param urls: + :param links: :return: initial set of data as :class:`OnlineCheck` instance containing the result id """ hoster, crypter = self.core.pluginManager.parseUrls(links) #: TODO: withhold crypter, derypt or add later # initial result does not contain the crypter links - tmp = [(url, LinkStatus(url, url, pluginname, -1, DS.Queued)) for url, pluginname in hoster + crypter] + tmp = [(url, LinkStatus(url, url, -1, DS.Queued, pluginname)) for url, pluginname in hoster + crypter] data = parseNames(tmp) - rid = self.core.threadManager.createResultThread(data) + rid = self.core.threadManager.createResultThread(self.primaryUID, data) return OnlineCheck(rid, data) @@ -54,8 +54,7 @@ class DownloadPreparingApi(ApiComponent): def checkContainer(self, filename, data): """ checks online status of urls and a submitted container file - :param urls: list of urls - :param container: container file name + :param filename: name of the file :param data: file content :return: :class:`OnlineCheck` """ @@ -88,13 +87,8 @@ class DownloadPreparingApi(ApiComponent): :return: `OnlineCheck`, if rid is -1 then there is no more data available """ result = self.core.threadManager.getInfoResult(rid) - - if "ALL_INFO_FETCHED" in result: - del result["ALL_INFO_FETCHED"] - return OnlineCheck(-1, result) - else: - return OnlineCheck(rid, result) - + if result and result.owner == self.primaryUID: + return result.toApiData() @RequirePerm(Permission.Add) def generatePackages(self, links): -- cgit v1.2.3