Fix maj...
Content-type: text/plain
Author: johnnyg
Revision: 6035
Log:
Upgrade older confs instead of just dying.
Fix major logic error when checking if an update is needed.
Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog 2009-12-16 12:46:57 UTC (rev 6034)
+++ branches/1.2_RC/ChangeLog 2009-12-16 13:46:39 UTC (rev 6035)
@@ -51,6 +51,7 @@
==== Blocklist ====
* Fix blocklist not working for all locales
+ * Fix blocklist checking for updates when it shouldn't
=== Deluge 1.2.0_rc4 (24 November 2009) ===
==== Core ====
Modified: branches/1.2_RC/deluge/plugins/blocklist/blocklist/core.py
===================================================================
--- branches/1.2_RC/deluge/plugins/blocklist/blocklist/core.py 2009-12-16
12:46:57 UTC (rev 6034)
+++ branches/1.2_RC/deluge/plugins/blocklist/blocklist/core.py 2009-12-16
13:46:39 UTC (rev 6035)
@@ -87,13 +87,16 @@
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
Modified: trunk/deluge/plugins/blocklist/blocklist/core.py
===================================================================
--- trunk/deluge/plugins/blocklist/blocklist/core.py 2009-12-16 12:46:57 UTC
(rev 6034)
+++ trunk/deluge/plugins/blocklist/blocklist/core.py 2009-12-16 13:46:39 UTC
(rev 6035)
@@ -87,13 +87,16 @@
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
--
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en.