From 896f1f1437442bb9a93a0664f3d447bbc0f444cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20H=C3=B6rnlein?= Date: Wed, 4 Feb 2015 00:02:27 +0100 Subject: Addressed some Extractor Issues --- module/plugins/hooks/ExtractArchive.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/ExtractArchive.py') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 47325608d..e1c05878c 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -103,7 +103,7 @@ class ArchiveQueue(object): class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.24" + __version__ = "1.25" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), @@ -312,7 +312,7 @@ class ExtractArchive(Hook): self.setPermissions(new_files) for filename in new_files: - file = fs_encode(filename) + file = fs_encode(save_join(filename, os.path.dirname(archive.filename))) if not os.path.exists(file): self.logDebug("New file %s does not exists" % filename) continue @@ -390,7 +390,7 @@ class ExtractArchive(Hook): if not encrypted or not self.getConfig("usepasswordfile"): archive.extract(password) else: - for pw in set(self.getPasswords(False) + [password]): + for pw in uniqify([password] + self.getPasswords(False)): try: self.logDebug("Try password: %s" % pw) @@ -465,7 +465,7 @@ class ExtractArchive(Hook): file = fs_encode(self.getConfig("passwordfile")) with open(file) as f: - for pw in f.read().splitlines()[:-1]: + for pw in f.read().splitlines(): passwords.append(pw) except IOError, e: -- cgit v1.2.3 From 0df373e5da9d33e4dea3e709521d4883ef7f9b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20H=C3=B6rnlein?= Date: Wed, 4 Feb 2015 20:41:03 +0100 Subject: [Unrar] Fix: Deleting All Files after Extraction --- module/plugins/hooks/ExtractArchive.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/ExtractArchive.py') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index e1c05878c..e1d6dff59 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -276,16 +276,16 @@ class ExtractArchive(Hook): for fname, fid in targets: name = os.path.basename(fname) - if not os.path.exists(fname): - self.logDebug(name, "File not found") - continue - pname = replace_patterns(fname, self.NAME_REPLACEMENTS) if pname not in processed: processed.append(pname) #: prevent extracting same file twice else: self.logDebug(name, "Skipped") continue + + if not os.path.exists(fname): + self.logDebug(name, "File not found") + continue self.logInfo(name, _("Extract to: %s") % out) try: -- cgit v1.2.3 From c1268bbbe35ebd8d5308051c169160257ad14c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20H=C3=B6rnlein?= Date: Wed, 4 Feb 2015 23:14:12 +0100 Subject: [ExtractArchive] fixed Queue Get --- module/plugins/hooks/ExtractArchive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/ExtractArchive.py') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index e1d6dff59..6e6a6862c 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -63,7 +63,7 @@ class ArchiveQueue(object): def get(self): - return self.plugin.getStorage("ExtractArchive:%s" % self.storage, "").decode('base64').split() + return [int(pid) for pid in self.plugin.getStorage("ExtractArchive:%s" % self.storage, "").decode('base64').split()] def set(self, value): -- cgit v1.2.3 From 39e87e03709b663086c96309bd6ebb3e2dc16afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20H=C3=B6rnlein?= Date: Thu, 5 Feb 2015 00:24:08 +0100 Subject: set interval smaller --- module/plugins/hooks/ExtractArchive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/ExtractArchive.py') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 6e6a6862c..b52fa026b 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -140,7 +140,7 @@ class ExtractArchive(Hook): self.queue = ArchiveQueue(self, "Queue") self.failed = ArchiveQueue(self, "Failed") - self.interval = 300 + self.interval = 60 self.extracting = False self.extractors = [] self.passwords = [] -- cgit v1.2.3 From 09b692852ae556cb3f40ffb3f607106faecd5758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20H=C3=B6rnlein?= Date: Thu, 5 Feb 2015 18:41:59 +0100 Subject: [ExtractArchive] Error Handling when broken ExtractArchive was used --- module/plugins/hooks/ExtractArchive.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/hooks/ExtractArchive.py') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index b52fa026b..4756d359c 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -63,7 +63,10 @@ class ArchiveQueue(object): def get(self): - return [int(pid) for pid in self.plugin.getStorage("ExtractArchive:%s" % self.storage, "").decode('base64').split()] + try: + return [int(pid) for pid in self.plugin.getStorage("ExtractArchive:%s" % self.storage, "").decode('base64').split()] + except Exception: + return [] def set(self, value): -- cgit v1.2.3