diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-08-18 17:01:17 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-08-18 17:01:17 +0200 |
commit | 9a6ea22616cf3cc67e292c908521b79764400faf (patch) | |
tree | 1924843f28d992490d867d0557da90dfb1da6404 /pyload/threads | |
parent | fixed login (diff) | |
download | pyload-9a6ea22616cf3cc67e292c908521b79764400faf.tar.xz |
new linkgrabber
Diffstat (limited to 'pyload/threads')
-rw-r--r-- | pyload/threads/DecrypterThread.py | 2 | ||||
-rw-r--r-- | pyload/threads/InfoThread.py | 14 | ||||
-rw-r--r-- | pyload/threads/ThreadManager.py | 3 |
3 files changed, 7 insertions, 12 deletions
diff --git a/pyload/threads/DecrypterThread.py b/pyload/threads/DecrypterThread.py index 77502569c..e4df2ee75 100644 --- a/pyload/threads/DecrypterThread.py +++ b/pyload/threads/DecrypterThread.py @@ -55,7 +55,7 @@ class DecrypterThread(BaseThread): plugin.logDebug("Decrypted", plugin_result) result.extend(plugin_result) - #TODO + #TODO package names are optional result = uniqify(result) pack_names = {} urls = [] diff --git a/pyload/threads/InfoThread.py b/pyload/threads/InfoThread.py index fba2a9056..6e685cdcf 100644 --- a/pyload/threads/InfoThread.py +++ b/pyload/threads/InfoThread.py @@ -4,7 +4,7 @@ from time import time from traceback import print_exc -from pyload.Api import LinkStatus +from pyload.Api import LinkStatus, DownloadStatus from pyload.utils.packagetools import parseNames from pyload.utils import has_method, accumulate @@ -100,17 +100,11 @@ class InfoThread(BaseThread): if len(self.cache) >= 20 or force: #used for package generating - tmp = [(name, (url, LinkStatus(name, plugin, "unknown", status, int(size)))) - for name, size, status, url in self.cache] + tmp = [(name, LinkStatus(url, name, plugin, int(size), status)) + for name, size, status, url in self.cache] data = parseNames(tmp) - result = {} - for k, v in data.iteritems(): - for url, status in v: - status.packagename = k - result[url] = status - - self.m.setInfoResults(self.rid, result) + self.m.setInfoResults(self.rid, data) self.cache = [] diff --git a/pyload/threads/ThreadManager.py b/pyload/threads/ThreadManager.py index 086e8ba51..a2e0aa400 100644 --- a/pyload/threads/ThreadManager.py +++ b/pyload/threads/ThreadManager.py @@ -106,7 +106,7 @@ class ThreadManager: def getInfoResult(self, rid): """returns result and clears it""" self.timestamp = time() + 5 * 60 - + # TODO: restrict user to his own results if rid in self.infoResults: data = self.infoResults[rid] self.infoResults[rid] = {} @@ -116,6 +116,7 @@ class ThreadManager: @lock def setInfoResults(self, rid, result): + self.core.evm.dispatchEvent("onlineResult:updated", rid, result) self.infoResults[rid].update(result) def getActiveDownloads(self, user=None): |