mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
Upgrade older confs instead of just dying.
Fix major logic error when checking if an update is needed.
This commit is contained in:
parent
3c5d5aa16e
commit
fe6c89a2e1
2 changed files with 5 additions and 1 deletions
|
@ -51,6 +51,7 @@
|
||||||
|
|
||||||
==== Blocklist ====
|
==== Blocklist ====
|
||||||
* Fix blocklist not working for all locales
|
* Fix blocklist not working for all locales
|
||||||
|
* Fix blocklist checking for updates when it shouldn't
|
||||||
|
|
||||||
=== Deluge 1.2.0_rc4 (24 November 2009) ===
|
=== Deluge 1.2.0_rc4 (24 November 2009) ===
|
||||||
==== Core ====
|
==== Core ====
|
||||||
|
|
|
@ -87,13 +87,16 @@ class Core(CorePluginBase):
|
||||||
|
|
||||||
self.reader = create_reader(self.config["list_type"], self.config["list_compression"])
|
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
|
update_now = False
|
||||||
if self.config["load_on_start"]:
|
if self.config["load_on_start"]:
|
||||||
if self.config["last_update"]:
|
if self.config["last_update"]:
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
last_update = datetime.fromtimestamp(self.config["last_update"])
|
last_update = datetime.fromtimestamp(self.config["last_update"])
|
||||||
check_period = timedelta(days=self.config["check_after_days"])
|
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
|
update_now = True
|
||||||
else:
|
else:
|
||||||
self.use_cache = True
|
self.use_cache = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue