diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-08-18 23:16:32 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-08-18 23:16:32 +0200 |
commit | 2433e5f35f285c3a9cdf9fc39e09dd9a69897307 (patch) | |
tree | 2d006aa2914d3493bbdc68573267c888431bb20f /module | |
parent | Merge pull request #1746 from GammaC0de/patch-4 (diff) | |
parent | Minor change to log output (diff) | |
download | pyload-2433e5f35f285c3a9cdf9fc39e09dd9a69897307.tar.xz |
Merge pull request #1741 from joberreiter/patch-1
[hooks/Checksum.py] Fix rename error and checksum comparison
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hooks/Checksum.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 6ecbfcda2..da4d35df1 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -38,7 +38,7 @@ def compute_checksum(local_file, algorithm): class Checksum(Addon): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __status__ = "testing" __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), @@ -131,15 +131,15 @@ class Checksum(Addon): for key in self.algorithms: if key in data: - checksum = computeChecksum(local_file, key.replace("-", "").lower()) + checksum = compute_checksum(local_file, key.replace("-", "").lower()) if checksum: - if checksum is data[key].lower(): + if checksum == data[key].lower(): self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % (pyfile.name, key.upper(), checksum)) break else: self.log_warning(_("%s checksum for file %s does not match (%s != %s)") % - (key.upper(), pyfile.name, checksum, data[key])) + (key.upper(), pyfile.name, checksum, data[key].lower())) self.check_failed(pyfile, local_file, "Checksums do not match") else: self.log_warning(_("Unsupported hashing algorithm"), key.upper()) @@ -186,7 +186,7 @@ class Checksum(Addon): local_file = fs_encode(fs_join(download_folder, data['NAME'])) algorithm = self.methods.get(file_type, file_type) - checksum = computeChecksum(local_file, algorithm) + checksum = compute_checksum(local_file, algorithm) if checksum is data['HASH']: self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % (data['NAME'], algorithm, checksum)) |