From c5daf5fa18490ff5977f06416b14bf0474822974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20H=C3=B6rnlein?= Date: Sat, 7 Feb 2015 03:08:28 +0100 Subject: [ExtractArchive] Fix: Show Status/Progressbar --- module/plugins/hooks/ExtractArchive.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 88036da39..81655b108 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -198,14 +198,14 @@ class ExtractArchive(Hook): @threaded - def allDownloadsProcessed(self): - if self.extract(self.queue.get()): #@NOTE: check only if all gone fine, no failed reporting for now + def allDownloadsProcessed(self, thread): + if self.extract(self.queue.get(), thread): #@NOTE: check only if all gone fine, no failed reporting for now self.manager.dispatchEvent("all_archives_extracted") self.manager.dispatchEvent("all_archives_processed") - def extract(self, ids): + def extract(self, ids, thread=None): if not ids: return False @@ -302,7 +302,7 @@ class ExtractArchive(Hook): fid) archive.init() - new_files = self._extract(archive, fid, pypack.password) + new_files = self._extract(archive, fid, pypack.password, thread) except Exception, e: self.logError(name, e) @@ -348,10 +348,11 @@ class ExtractArchive(Hook): return True if not failed else False - def _extract(self, archive, fid, password): + def _extract(self, archive, fid, password, thread): pyfile = self.core.files.getFile(fid) name = os.path.basename(archive.filename) + thread.addActive(pyfile) pyfile.setStatus("processing") encrypted = False -- cgit v1.2.3