From f03d1818fa5f7904581a2a9e1c3a765e9eea4139 Mon Sep 17 00:00:00 2001 From: John Garland Date: Wed, 16 Dec 2009 13:46:39 +0000 Subject: [PATCH] Upgrade older confs instead of just dying. Fix major logic error when checking if an update is needed. --- deluge/plugins/blocklist/blocklist/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deluge/plugins/blocklist/blocklist/core.py b/deluge/plugins/blocklist/blocklist/core.py index f525b6059..e87cb55f0 100644 --- a/deluge/plugins/blocklist/blocklist/core.py +++ b/deluge/plugins/blocklist/blocklist/core.py @@ -87,13 +87,16 @@ class Core(CorePluginBase): self.reader = create_reader(self.config["list_type"], self.config["list_compression"]) + if type(self.config["last_update"]) is not float: + self.config.config["last_update"] = 0.0 + update_now = False if self.config["load_on_start"]: if self.config["last_update"]: now = datetime.now() last_update = datetime.fromtimestamp(self.config["last_update"]) check_period = timedelta(days=self.config["check_after_days"]) - if not self.config["last_update"] or last_update + check_period >= now: + if not self.config["last_update"] or last_update + check_period < now: update_now = True else: self.use_cache = True