From 9814cad0b95ed78bcd5ce46940c70cee20efa32d Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 15 Mar 2009 02:09:32 +0000 Subject: [PATCH] Fix tracker error filtering --- deluge/core/filtermanager.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deluge/core/filtermanager.py b/deluge/core/filtermanager.py index eaf0b8fe8..eed25bf27 100644 --- a/deluge/core/filtermanager.py +++ b/deluge/core/filtermanager.py @@ -67,14 +67,18 @@ def filter_one_keyword(torrent_ids, keyword): break def tracker_error_filter(torrent_ids, values): - # We only care about Error here + filtered_torrent_ids = [] + tm = component.get("TorrentManager") + + # If this is a tracker_host, then we need to filter on it if values[0] != "Error": - return torrent_ids + for torrent_id in torrent_ids: + if values[0] in tm[torrent_id].get_status(["tracker_host"])["tracker_host"]: + filtered_torrent_ids.append(torrent_id) + return filtered_torrent_ids # Check all the torrent's tracker_status for 'Error:' and only return torrent_ids # that have this substring in their tracker_status - filtered_torrent_ids = [] - tm = component.get("TorrentManager") for torrent_id in torrent_ids: if "Error:" in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]: filtered_torrent_ids.append(torrent_id)