diff --git a/app/controllers/artist_controller.rb b/app/controllers/artist_controller.rb index 53daa41..015126e 100644 --- a/app/controllers/artist_controller.rb +++ b/app/controllers/artist_controller.rb @@ -55,7 +55,7 @@ class ArtistController < ApplicationController end render :json => { :query => params[:query], - :suggestions => suggestions + :suggestions => suggestions.take(10) } end @@ -63,7 +63,7 @@ class ArtistController < ApplicationController return nil if query.nil? or query.strip.empty? json = ActiveSupport::JSON.decode(open( 'http://www.last.fm/search/autocomplete' << - '?q=' << URI.escape(query) + '?rows=30&q=' << URI.escape(query) ).read) return json.empty? ? nil : json end