lib/groove-dl/cli/search.rb in groove-dl-0.2.0 vs lib/groove-dl/cli/search.rb in groove-dl-0.3.0
- old
+ new
@@ -14,16 +14,10 @@
type = 'Songs' if opts[:s]
type = 'Playlists' if opts[:p]
query = opts[:s] if opts[:s]
query = opts[:p] if opts[:p]
- results = client.request('getResultsFromSearch',
- type: type,
- query: query)['result']
- results.map! do |data|
- next Grooveshark::Song.new data if type == 'Songs'
- data
- end
+ results = client.search(type, query)
displayer = GrooveDl::Displayer.new(results, type)
displayer.render
end
end