changeset 2850:b1390d9f35bf trunk

Some more improvements.
author William Pitcock <nenolod@atheme.org>
date Tue, 19 Jun 2007 17:01:27 -0500
parents 97dc42683fc6
children 3b730938c9eb
files contrib/xchat-audacious.py
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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"