summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/rbot/plugins/lastfm.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb
index d99a9526..2e5dc3f5 100644
--- a/data/rbot/plugins/lastfm.rb
+++ b/data/rbot/plugins/lastfm.rb
@@ -235,8 +235,11 @@ class LastFmPlugin < Plugin
artist = first.elements["artist"].text
track = first.elements["name"].text
albumtxt = first.elements["album"].text
- year = get_album(artist, albumtxt)[2]
- album = "[#{albumtxt}, #{year}] " unless albumtxt == nil or year.length == 1
+ album = ""
+ if albumtxt
+ year = get_album(artist, albumtxt)[2]
+ album = "[#{albumtxt}, #{year}] " if year
+ end
date = first.elements["date"].attributes["uts"]
past = Time.at(date.to_i)
if now == "true"