]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/lastfm.rb
lastfm: make "tracks" optional in mappings for lovedtracks and recenttracks
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / lastfm.rb
index 52f9754ec524d4fdcaa73dd8caad943610fde395..811a63aa1dc5e6057948aa007082dde4b65d0d94 100644 (file)
@@ -441,8 +441,9 @@ class LastFmPlugin < Plugin
 
   def lastfm(m, params)
     action = case params[:action]
-    when "neighbors"   then "neighbours"
-    when "recentracks" then "recenttracks"
+    when "neighbors" then "neighbours"
+    when "recentracks", "recent" then "recenttracks"
+    when "loved" then "lovedtracks"
     when /^weekly(track|album|artist)s$/
       "weekly#{$1}chart"
     when "events"
@@ -581,7 +582,7 @@ class LastFmPlugin < Plugin
           format = "%{artist} (%{bold}%{plays}%{bold})"
           artist = item.elements["name"].text
         when :toptracks, :topalbums
-          format = "%{artist} - (%{title} %{bold}%{plays}%{bold})"
+          format = "%{artist} - %{title} (%{bold}%{plays}%{bold})"
           artist = item.elements["artist/name"].text
         end
 
@@ -620,7 +621,7 @@ plugin.map 'lastfm compare to :user2', :action => :tasteometer, :thread => true
 plugin.map 'lastfm compare [:user1] [to] :user2', :action => :tasteometer, :thread => true
 plugin.map "lastfm [user] [:num] :action [:user]", :thread => true,
   :requirements => { :action =>
-    /^(?:events|shouts|friends|neighbou?rs|(?:loved|recent?)tracks|top(?:album|artist|track)s?|weekly(?:albums?|artists?|tracks?)(?:chart)?)$/
+    /^(?:events|shouts|friends|neighbou?rs|loved(?:tracks)?|recent(?:t?racks)?|top(?:album|artist|track)s?|weekly(?:albums?|artists?|tracks?)(?:chart)?)$/
 }
 plugin.map 'lastfm [user] [:num] :action [:user] over [*period]', :thread => true,
   :requirements => {