|
|
@@ -196,8 +196,11 @@ def validate(torrent, basedir, with_file_hashes=None): |
|
|
|
|
|
|
|
def apply_fun(data, fname, offset): |
|
|
|
if with_file_hashes is not None: |
|
|
|
hashobj, curoff = file_hashes.setdefault(fname, |
|
|
|
(with_file_hashes(), 0)) |
|
|
|
try: |
|
|
|
hashobj, curoff = file_hashes[fname] |
|
|
|
except KeyError: |
|
|
|
hashobj, curoff = with_file_hashes(), 0 |
|
|
|
file_hashes[fname] = hashobj, curoff |
|
|
|
|
|
|
|
if curoff == offset: |
|
|
|
hashobj.update(data) |
|
|
|