summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/rbot/plugins/lastfm.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb
index ee9ef5ba..f97da63f 100644
--- a/data/rbot/plugins/lastfm.rb
+++ b/data/rbot/plugins/lastfm.rb
@@ -315,10 +315,15 @@ class LastFmPlugin < Plugin
artist = first.elements["artist"].text
track = first.elements["name"].text
albumtxt = first.elements["album"].text
- album = ""
- if albumtxt
+ album = if albumtxt
year = get_album(artist, albumtxt)[2]
- album = "[#{albumtxt}, #{year}]" if year
+ if year
+ "[#{albumtxt}, #{year}]"
+ else
+ "[#{albumtxt}]"
+ end
+ else
+ nil
end
past = nil
date = XPath.first(first, "//date")