diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-31 11:19:45 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-31 11:19:45 +0100 |
commit | 4eb3ecd44244734463d9fdec1a68cf25dcb0b625 (patch) | |
tree | a90b2db2e2178f001d39878eaf3a6ab85bef139d /module | |
parent | [ExtractArchive] Fix typo (diff) | |
download | pyload-4eb3ecd44244734463d9fdec1a68cf25dcb0b625.tar.xz |
[ExtractArchive] Fix https://github.com/pyload/pyload/issues/1109 and https://github.com/pyload/pyload/issues/1116
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hooks/ExtractArchive.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index f1b73bf5f..a09e96d1f 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -62,17 +62,25 @@ class ArchiveQueue(object): def get(self): - return self.plugin.getStorage("ExtractArchive:%s" % self.storage, []) + return self.plugin.getStorage("ExtractArchive:%s" % self.storage, "").decode('base64').split() def set(self, value): - return self.plugin.setStorage("ExtractArchive:%s" % self.storage, value) + if isinstance(value, list): + item = str(value)[1:-1].replace(' ', '').replace(',', ' ') + else: + item = str(value).strip() + return self.plugin.setStorage("ExtractArchive:%s" % self.storage, item.encode('base64')[:-1]) def clean(self): return self.set([]) + def delete(self): + return self.plugin.delStorage("ExtractArchive:%s" % self.storage) + + def add(self, item): queue = self.get() if item not in queue: @@ -91,7 +99,7 @@ class ArchiveQueue(object): class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.14" + __version__ = "1.15" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract full path" , True ), @@ -387,7 +395,7 @@ class ExtractArchive(Hook): self.logInfo(fname, _("Extracting finished")) extracted_files = archive.getExtractedFiles() - self.manager.dispatchEvent("archive_extracted", pyfile, archive.out, archive.file, extracted_files) + self.manager.dispatchEvent("archive_extracted", pyfile, archive.out, archive.filename, extracted_files) return extracted_files |