Speedup in tracker_error_filter

This commit is contained in:
bendikro 2013-05-25 00:51:35 +02:00 committed by Calum Lind
parent b76cdc2227
commit 899c575ae8
1 changed files with 2 additions and 1 deletions

View File

@ -110,9 +110,10 @@ def tracker_error_filter(torrent_ids, values):
filtered_torrent_ids.append(torrent_id) filtered_torrent_ids.append(torrent_id)
return filtered_torrent_ids return filtered_torrent_ids
error_str = _("Error") + ":"
# Check torrent's tracker_status for 'Error:' and return those torrent_ids # Check torrent's tracker_status for 'Error:' and return those torrent_ids
for torrent_id in 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) filtered_torrent_ids.append(torrent_id)
return filtered_torrent_ids return filtered_torrent_ids