This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #1 from EtienneLem/browse-in-app

Add option to browse current track directly in Rdio app
  • Loading branch information...
pengwynn committed Dec 27, 2012
2 parents e16b8b7 + 2c2c0f9 commit c55457d557adf344bae8e5d05eaa4bc10b3c1024
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/rdio.rb
View
@@ -81,9 +81,9 @@ def self.set_volume(pct = 30)
tell_rdio "set the sound volume to #{pct}"
end
- def self.rdio_url
+ def self.rdio_url(protocol = 'http')
path = tell_rdio 'rdio url of the current track'
- "http://www.rdio.com#{path}"
+ "#{protocol}://www.rdio.com#{path}"
end
def self.current_track_key
@@ -162,7 +162,8 @@ def self.add_to_collection(tracks)
skips_pre
command :browse do |c|
c.action do |global_options,options,args|
- exec "open '#{rdio_url}'"
+ protocol = args.first == 'app' ? 'rdio' : 'http'
+ exec "open '#{rdio_url protocol}'"
end
end

0 comments on commit c55457d

Please sign in to comment.