lib/firstfm/geo.rb in firstfm-0.3.0 vs lib/firstfm/geo.rb in firstfm-0.3.1
- old
+ new
@@ -70,11 +70,11 @@
:metro => metro,
:start => start_timestamp,
:end => end_timestamp,
:page => page,
:limit => limit,
- :api_key => Firstfm::CONFIG['api_key']
- }})
+ :api_key => Firstfm::CONFIG['api_key'] }.reject {|k,v| v.nil?}
+ })
artists_array = (response and response['lfm'] and response['lfm']['topartists'] and response['lfm']['topartists']['artist']) || []
artists = Artist.init_from_array(artists_array)
WillPaginate::Collection.create(page, limit) do |pager|
pager.replace artists
\ No newline at end of file