mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-04 15:43:28 +00:00
Extractor: Refactor and fix tar.* issue on windows
This commit is contained in:
parent
e4118048eb
commit
7fbe163c24
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user