From d24a406af7e51f9c6dc7e6e90facd18272353e98 Mon Sep 17 00:00:00 2001 From: Casey Link Date: Sat, 5 Feb 2011 12:18:51 -0500 Subject: [PATCH] add ability to get now playing info on others. --- modules/lastfm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/lastfm.py b/modules/lastfm.py index 3f1f2fb..b8394a7 100644 --- a/modules/lastfm.py +++ b/modules/lastfm.py @@ -70,7 +70,9 @@ lastfm_set.rule = (['lastfm-set'], r'(\S+)\s+(?:(.*?),(.*)|(\S+))') def now_playing(phenny, input): nick = input.nick - user = resolve_username(nick) + user = input.group(2) + if not user: + user = resolve_username(nick) if not user: user = nick try: @@ -89,7 +91,7 @@ def now_playing(phenny, input): phenny.say("%s hasn't played anything recently" % (user)) return tracks = list(recenttracks[0]) - print etree.tostring(recenttracks[0]) + #print etree.tostring(recenttracks[0]) first = tracks[0] now = True if first.get("nowplaying") == "true" else False tags = {}