From 899c575ae8a4876b8349a8404cc7edbf4e0d6eee Mon Sep 17 00:00:00 2001 From: bendikro Date: Sat, 25 May 2013 00:51:35 +0200 Subject: [PATCH] Speedup in tracker_error_filter --- deluge/core/filtermanager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deluge/core/filtermanager.py b/deluge/core/filtermanager.py index 4643d4637..89dfd64ea 100644 --- a/deluge/core/filtermanager.py +++ b/deluge/core/filtermanager.py @@ -110,9 +110,10 @@ def tracker_error_filter(torrent_ids, values): filtered_torrent_ids.append(torrent_id) return filtered_torrent_ids + error_str = _("Error") + ":" # Check torrent's tracker_status for 'Error:' and return those torrent_ids for torrent_id in torrent_ids: - if _("Error") + ":" in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]: + if error_str in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]: filtered_torrent_ids.append(torrent_id) return filtered_torrent_ids