diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-08-07 20:52:35 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-08-07 20:52:35 +0200 |
commit | 1fe83a93650db27d7ecf4c3476ce2e00f994513e (patch) | |
tree | adc20c882b74421176a3d56446b9cf1589c9d789 /module/plugins | |
parent | closed #375 (diff) | |
download | pyload-1fe83a93650db27d7ecf4c3476ce2e00f994513e.tar.xz |
closed #359
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hooks/UnRar.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/module/plugins/hooks/UnRar.py b/module/plugins/hooks/UnRar.py index 778ae669c..94ae9da11 100644 --- a/module/plugins/hooks/UnRar.py +++ b/module/plugins/hooks/UnRar.py @@ -19,14 +19,15 @@ from __future__ import with_statement import sys +import os +from os.path import exists, join, isabs, isdir +from os import remove, makedirs, rmdir, listdir, chown, chmod +from traceback import print_exc from module.plugins.Hook import Hook from module.lib.pyunrar import Unrar, WrongPasswordError, CommandError, UnknownError, LowRamError -from traceback import print_exc -import os -from os.path import exists, join, isabs, isdir -from os import remove, makedirs, rmdir, listdir, chown, chmod +from module.utils import save_join if os.name != "nt": from pwd import getpwnam @@ -156,10 +157,8 @@ class UnRar(Hook): download_folder = self.core.config['general']['download_folder'] self.core.log.debug(_("download folder %s") % download_folder) - if self.core.config['general']['folder_per_package']: - folder = join(download_folder, pack.folder.decode(sys.getfilesystemencoding())) - else: - folder = download_folder + folder = save_join(download_folder, pack.folder, "") + destination = folder if self.getConfig("unrar_destination") and not self.getConfig("unrar_destination").lower() == "none": @@ -168,9 +167,9 @@ class UnRar(Hook): if self.core.config['general']['folder_per_package']: sub = pack.folder.decode(sys.getfilesystemencoding()) if isabs(destination): - destination = join(destination, sub) + destination = join(destination, sub, "") else: - destination = join(folder, destination, sub) + destination = join(folder, destination, sub, "") self.core.log.debug(_("Destination folder %s") % destination) if not exists(destination): |