From c703c03c616ebbfcd85ebd7dd324cf889d7fe1f9 Mon Sep 17 00:00:00 2001 From: Casey Link Date: Sat, 5 Feb 2011 14:33:39 -0500 Subject: [PATCH] fix strange album issues --- modules/lastfm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/lastfm.py b/modules/lastfm.py index 81e1666..942b73d 100644 --- a/modules/lastfm.py +++ b/modules/lastfm.py @@ -109,7 +109,10 @@ def now_playing(phenny, input): track = tags['name'].text.strip() artist = tags['artist'].text.strip() - album = tags['album'].text.strip() + + album = "unknown" + if tags['album'].text: + album = tags['album'].text date = None stamp = None @@ -119,11 +122,11 @@ def now_playing(phenny, input): if now: present = get_verb(nick)[1] - phenny.say("%s %s \"%s\" by %s-%s" %(user.strip(), present.strip(), track, artist, album)) + phenny.say("%s %s \"%s\" by %s on %s" %(user.strip(), present.strip(), track, artist, album )) return else: past = get_verb(nick)[0] - phenny.say("%s %s \"%s\" by %s-%s %s ago" %(user.strip(), past.strip(), track, artist, album, pretty_date(stamp))) + phenny.say("%s %s \"%s\" by %s on %s %s ago" %(user.strip(), past.strip(), track, artist, album, pretty_date(stamp))) now_playing.commands = ['np']