summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2013-02-23 01:55:05 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2013-02-23 02:07:09 +0000
commit7fbe163c24de63526a3ee96869796d58fe175f02 (patch)
treeec5a1a1eb46943628017db0910bebb53fcb97c4d
parente4118048ebc92d053b3ec106177478e945bf216e (diff)
downloaddeluge-7fbe163c24de63526a3ee96869796d58fe175f02.tar.gz
deluge-7fbe163c24de63526a3ee96869796d58fe175f02.tar.bz2
deluge-7fbe163c24de63526a3ee96869796d58fe175f02.zip
Extractor: Refactor and fix tar.* issue on windows
-rw-r--r--deluge/plugins/extractor/extractor/core.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/deluge/plugins/extractor/extractor/core.py b/deluge/plugins/extractor/extractor/core.py
index 7df86a447..50f3faf26 100644
--- a/deluge/plugins/extractor/extractor/core.py
+++ b/deluge/plugins/extractor/extractor/core.py
@@ -132,11 +132,8 @@ class Core(CorePluginBase):
files = tid.get_files()
for f in files:
cmd = ''
- file_ext = os.path.splitext(f["path"])[1]
- file_ext_sec = os.path.splitext(os.path.splitext(f["path"])[0])[1]
- if file_ext in (".gz", ".bz2", ".lzma", ".xz") and file_ext_sec == ".tar":
- cmd = EXTRACT_COMMANDS[".tar" + file_ext]
- elif file_ext in EXTRACT_COMMANDS:
+ file_ext = os.path.splitext(os.path.splitext(f["path"])[0])[1] + os.path.splitext(f["path"])[1]
+ if file_ext in EXTRACT_COMMANDS:
cmd = EXTRACT_COMMANDS[file_ext]
else:
log.error("EXTRACTOR: Can't extract unknown file type: %s", file_ext)
@@ -146,7 +143,7 @@ class Core(CorePluginBase):
fpath = os.path.join(tid_status["save_path"], os.path.normpath(f["path"]))
# Get the destination path
- dest = os.path.normpath(self.config["extract_path"])
+ dest = os.path.normpath(self.config["extract_path"])
if self.config["use_name_folder"]:
name = tid_status["name"]
dest = os.path.join(dest, name)