diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-05 21:01:34 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-05 21:01:34 +0100 |
commit | c135b3575179015f01cb9e51034bac057fa8f014 (patch) | |
tree | 6ae5505190948d8c249c10489f23273894d1f746 /module/plugins | |
parent | simplehoster - use parseFileSize (diff) | |
download | pyload-c135b3575179015f01cb9e51034bac057fa8f014.tar.xz |
little fs improvements
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/Plugin.py | 14 | ||||
-rw-r--r-- | module/plugins/hooks/ExtractArchive.py | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index e2aadb38e..f7587d3f2 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -532,16 +532,16 @@ class Plugin(Base): :param read_size: amount of bytes to read from files larger then max_size :return: dictionary key of the first rule that matched """ - fs_name = fs_encode(self.lastDownload) - if not exists(fs_name): return None + lastDownload = fs_encode(self.lastDownload) + if not exists(lastDownload): return None - size = stat(fs_name) + size = stat(lastDownload) size = size.st_size if api_size and api_size <= size: return None elif size > max_size and not read_size: return None self.log.debug("Download Check triggered") - f = open(fs_name, "rb") + f = open(lastDownload, "rb") content = f.read(read_size if read_size else -1) f.close() #produces encoding errors, better log to other file in the future? @@ -550,13 +550,13 @@ class Plugin(Base): if type(rule) in (str, unicode): if rule in content: if delete: - remove(fs_name) + remove(lastDownload) return name elif hasattr(rule, "search"): m = rule.search(content) if m: if delete: - remove(fs_name) + remove(lastDownload) self.lastCheck = m return name @@ -586,7 +586,7 @@ class Plugin(Base): raise SkipDownload(pyfile.pluginname) download_folder = self.config['general']['download_folder'] - location = fs_encode(save_join(download_folder, pack.folder, self.pyfile.name)) + location = save_join(download_folder, pack.folder, self.pyfile.name) if starting and self.core.config['download']['skip_existing'] and exists(location): size = os.stat(location).st_size diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 359bfca76..82e9c1d36 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -165,7 +165,7 @@ class ExtractArchive(Hook): for plugin in self.plugins: targets = plugin.getTargets(files_ids) - if targets: self.logDebug("Targets: %s" % targets) + if targets: self.logDebug("Targets for %s: %s" % (plugin.__name__, targets)) for target, fid in targets: if target in extracted: self.logDebug(basename(target), "skipped") |