lib/firstfm/track.rb in firstfm-0.2.2 vs lib/firstfm/track.rb in firstfm-0.2.3

- old
+ new

@@ -12,10 +12,10 @@ response = get("/2.0/", {:query => {:method => 'track.search', :track => track, :page => page, :limit => limit, :api_key => Firstfm::CONFIG['api_key']}}) tracks_array = (response and response["lfm"] and response["lfm"]["results"] and response["lfm"]["results"]["trackmatches"] and response["lfm"]["results"]["trackmatches"]["track"]) || [] tracks = Track.init_from_array(tracks_array) WillPaginate::Collection.create(page, limit) do |pager| pager.replace tracks - pager.total_entries = response['lfm']['results']['opensearch:totalResults'].to_i + pager.total_entries = response['lfm']['results']['totalResults'].to_i end end def self.init_from_array(array) return [] unless array.is_a?(Array) \ No newline at end of file