diff options
-rw-r--r-- | pyload/threads/DecrypterThread.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pyload/threads/DecrypterThread.py b/pyload/threads/DecrypterThread.py index 1248e4733..9b26e468d 100644 --- a/pyload/threads/DecrypterThread.py +++ b/pyload/threads/DecrypterThread.py @@ -35,18 +35,19 @@ class DecrypterThread(BaseThread): api = self.core.api.withUserContext(self.owner) links, packages = self.decrypt(accumulate(self.data), pack.password) + # if there is only one package links will be added to current one + if len(packages) == 1: + # TODO: also rename the package (optionally) + links.extend(packages[0].links) + del packages[0] + if links: self.log.info( _("Decrypted %(count)d links into package %(name)s") % {"count": len(links), "name": pack.name}) api.addLinks(self.pid, [l.url for l in links]) - # if there is only one package links will be added to current one - if len(packages) == 1: - # TODO: also rename the package (optionally) - api.addLinks(self.pid, packages[0].getURLs()) - else: - for p in packages: - api.addPackage(p.name, p.getURLs(), pack.password) + for p in packages: + api.addPackage(p.name, p.getURLs(), pack.password) self.core.files.setDownloadStatus(self.fid, DS.Finished if not self.error else DS.Failed) self.m.done(self) |