From 52541df3f92bff3c692dd96b8464d696e079ee22 Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Sat, 14 Jul 2012 12:12:19 +0200 Subject: [PATCH] Added another check to prevent event spam when adding a new torrent --- deluge/ui/console/eventlog.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/eventlog.py b/deluge/ui/console/eventlog.py index b82f5beda..6a195d940 100644 --- a/deluge/ui/console/eventlog.py +++ b/deluge/ui/console/eventlog.py @@ -91,8 +91,14 @@ class EventLog(component.Component): if state in colors.state_color: state = colors.state_color[state] + state + t_name = self.console.get_torrent_name(torrent_id) + + #Again, it's most likely a new torrent + if not t_name: + return + self.write("%s: {!info!}%s ({!cyan!}%s{!info!})" % - (state, self.console.get_torrent_name(torrent_id), torrent_id)) + (state, t_name, torrent_id)) def on_torrent_finished_event(self, torrent_id): if component.get("AllTorrents").config["ring_bell"]: