summaryrefslogtreecommitdiffstats
path: root/pyload/api
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-26 16:40:38 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-26 16:40:50 +0200
commit967d6dd16c25ceba22dcd105079f72534ddb87e9 (patch)
tree4c971ff446dc955f1884e5aa80ef4cb62bbf55fe /pyload/api
parentnew DLC plugins (diff)
downloadpyload-967d6dd16c25ceba22dcd105079f72534ddb87e9.tar.xz
rewritten decrypter and info fetching thread
Diffstat (limited to 'pyload/api')
-rw-r--r--pyload/api/DownloadPreparingApi.py18
1 files changed, 6 insertions, 12 deletions
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):