Rev3106, Cancel other part downloads when delete optional file

This commit is contained in:
shortcutme 2017-10-16 01:43:51 +02:00
parent 3f52f78af2
commit 807dc866e5
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
2 changed files with 6 additions and 1 deletions

View File

@ -322,6 +322,11 @@ class ContentManagerPlugin(object):
sha512 = file_info["sha512"]
if sha512 in self.site.storage.piecefields:
del self.site.storage.piecefields[sha512]
# Also remove other pieces of the file from download queue
for key in self.site.bad_files.keys():
if key.startswith(inner_path + "|"):
del self.site.bad_files[key]
return super(ContentManagerPlugin, self).optionalRemove(inner_path, hash, size)

View File

@ -10,7 +10,7 @@ class Config(object):
def __init__(self, argv):
self.version = "0.6.0"
self.rev = 3105
self.rev = 3106
self.argv = argv
self.action = None
self.config_file = "zeronet.conf"