Added another check to prevent event spam when adding a new torrent

This commit is contained in:
Asmageddon 2012-07-14 12:12:19 +02:00
parent 39d75ee7d5
commit 52541df3f9
1 changed files with 7 additions and 1 deletions

View File

@ -91,8 +91,14 @@ class EventLog(component.Component):
if state in colors.state_color: if state in colors.state_color:
state = colors.state_color[state] + state 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!})" % 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): def on_torrent_finished_event(self, torrent_id):
if component.get("AllTorrents").config["ring_bell"]: if component.get("AllTorrents").config["ring_bell"]: