From 807dc866e5e460f7322355f9bd7e9f1defba5ace Mon Sep 17 00:00:00 2001 From: shortcutme Date: Mon, 16 Oct 2017 01:43:51 +0200 Subject: [PATCH] Rev3106, Cancel other part downloads when delete optional file --- plugins/Bigfile/BigfilePlugin.py | 5 +++++ src/Config.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/Bigfile/BigfilePlugin.py b/plugins/Bigfile/BigfilePlugin.py index f13b8fbe..87c94cf8 100644 --- a/plugins/Bigfile/BigfilePlugin.py +++ b/plugins/Bigfile/BigfilePlugin.py @@ -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) diff --git a/src/Config.py b/src/Config.py index ef56152e..038d5424 100644 --- a/src/Config.py +++ b/src/Config.py @@ -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"