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)