summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/hooks/ExtractArchive.py3
-rw-r--r--module/plugins/internal/UnRar.py6
2 files changed, 4 insertions, 5 deletions
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 23ae6c543..74721d166 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -160,7 +160,8 @@ class ExtractArchive(Hook):
if self.getConfig("destination") and self.getConfig("destination").lower() != "none":
if exists(self.getConfig("destination")):
- out = save_join(self.getConfig("destination"), "")
+ out = save_join(dl, p.folder, self.getConfig("destination"), "")
+ #relative to package folder if destination is relative, otherwise absolute path overwrites them
files_ids = [(save_join(dl, p.folder, x["name"]), x["id"]) for x in p.getChildren().itervalues()]
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index 7ba1d01ba..1943f69e0 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -18,16 +18,14 @@
"""
import os
+import re
from os.path import join
from glob import glob
from subprocess import Popen, PIPE
-
from module.plugins.hooks.ExtractArchive import AbtractExtractor
from module.utils import save_join, decode
-import re
-
class UnRar(AbtractExtractor):
__name__ = "UnRar"
__version__ = "0.1"
@@ -138,7 +136,7 @@ class UnRar(AbtractExtractor):
def getDeleteFiles(self):
if ".part" in self.file:
- return glob(self.file.replace("0", "*").replace("1", "*"))
+ return glob(re.sub("(?<=\.part)([01]+)", "*", self.file, re.IGNORECASE))
return [self.file]
def listContent(self):