# HG changeset patch # User William Pitcock # Date 1182290487 18000 # Node ID b1390d9f35bf01e8be3fe0643459a9ac70c06d8c # Parent 97dc42683fc68abd30a0f1856deb72dec5df05ed Some more improvements. diff -r 97dc42683fc6 -r b1390d9f35bf contrib/xchat-audacious.py --- a/contrib/xchat-audacious.py Tue Jun 19 16:07:25 2007 -0500 +++ b/contrib/xchat-audacious.py Tue Jun 19 17:01:27 2007 -0500 @@ -94,8 +94,10 @@ ignore_services = 0 return 1 +last_title = None + def presence_notification_dispatch(userdata=None): - global ignore_services + global ignore_services, last_title aud = get_aud() @@ -105,16 +107,19 @@ title = aud.SongTitle(pos).encode("utf8") - slist = get_servers() - for i in slist: - ctx = xchat.find_context(i) + if title != last_title: + slist = get_servers() + for i in slist: + ctx = xchat.find_context(i) - ctx.command("nickserv set qproperty np %s" % (title)) + ctx.command("nickserv set qproperty np %s" % (title)) + + last_title = title return 1 presence_notification_dispatch() xchat.hook_timer(60000, presence_notification_dispatch) -xchat.hook_timer(1000, unset_ignore_services) +xchat.hook_timer(2000, unset_ignore_services) print "xchat-audacious $Id: xchat-audacious.py 4574 2007-05-16 07:46:17Z deitarion $ loaded"