rating = _("Very Low")
end
- reply = _("%{a}'s and %{b}'s musical compatibility rating is %{bold}%{r}%{bold}") % {
+ common_artists = unless artists.empty?
+ _(" and music they have in common includes: %{artists}") % {
+ :artists => Utils.comma_list(artists) }
+ else
+ nil
+ end
+
+ m.reply _("%{a}'s and %{b}'s musical compatibility rating is %{bold}%{r}%{bold}%{common}") % {
:a => user1,
:b => user2,
:r => rating.downcase,
- :bold => Bold
+ :bold => Bold,
+ :common => common_artists
}
-
- reply << _(" and music they have in common includes: %{artists}") % {
- :artists => artists.join(", ")
- } unless artists.empty?
-
- m.reply reply
end
def now_playing(m, params)
elsif friends.length <= num
reply = _("%{user} has %{total} friends: %{friends}")
else
- reply = _("%{user} has %{total} friends, including %{friends}")
- reply << seemore
+ reply = _("%{user} has %{total} friends, including %{friends}%{seemore}")
end
m.reply reply % {
:user => user,
:total => friends.size,
- :friends => friends.shuffle[0, num].join(", "),
- :uri => "http://www.last.fm/user/#{CGI.escape user}/friends"
+ :friends => Utils.comma_list(friends.shuffle[0, num]),
+ :uri => "http://www.last.fm/user/#{CGI.escape user}/friends",
+ :seemore => seemore
}
when :lovedtracks
loved = doc.root.get_elements("lovedtracks/track").map do |track|
elsif loved.length <= num
reply = _("%{user} has loved %{total} tracks: %{tracks}")
else
- reply = _("%{user} has loved %{total} tracks, including %{tracks}")
- reply << seemore
+ reply = _("%{user} has loved %{total} tracks, including %{tracks}%{seemore}")
end
m.reply reply % {
:user => user,
:total => loved.size,
- :tracks => loved_prep.join(", "),
- :uri => "http://www.last.fm/user/#{CGI.escape user}/library/loved"
+ :tracks => Utils.comma_list(loved_prep),
+ :uri => "http://www.last.fm/user/#{CGI.escape user}/library/loved",
+ :seemore => seemore
}
when :neighbours
nbrs = doc.root.get_elements("neighbours/user").map do |u|
elsif nbrs.length <= num
reply = _("%{user}'s musical neighbours are %{nbrs}")
else
- reply = _("%{user}'s musical neighbours include %{nbrs}")
- reply << seemore
+ reply = _("%{user}'s musical neighbours include %{nbrs}%{seemore}")
end
m.reply reply % {
- :user => user,
- :nbrs => nbrs.shuffle[0, num].join(", "),
- :uri => "http://www.last.fm/user/#{CGI.escape user}/neighbours"
+ :user => user,
+ :nbrs => Utils.comma_list(nbrs.shuffle[0, num]),
+ :uri => "http://www.last.fm/user/#{CGI.escape user}/neighbours",
+ :seemore => seemore
}
when :recenttracks
tracks = doc.root.get_elements("recenttracks/track").map do |track|
m.reply _("%{user} hasn't played anything recently") % { :user => user }
else
m.reply _("%{user} has recently played %{tracks}") %
- { :user => user, :tracks => tracks_prep.join(", ") }
+ { :user => user, :tracks => Utils.comma_list(tracks_prep) }
end
when :shouts
shouts = doc.root.get_elements("shouts/shout")