X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/blobdiff_plain/ad84791b951f4ebdfae9c6bf0a54244a8b5c8f16..34d0bf15a6f4009de376ceed1d7d5cca24a8dfe7:/doc/Lyricli/Sources/Rdio.html?ds=inline diff --git a/doc/Lyricli/Sources/Rdio.html b/doc/Lyricli/Sources/Rdio.html index e99af89..51ce909 100644 --- a/doc/Lyricli/Sources/Rdio.html +++ b/doc/Lyricli/Sources/Rdio.html @@ -6,7 +6,7 @@
-23 -24 -25 -26 -27+27 +28 +29 +30 +31
# File 'lib/lyricli/sources/rdio.rb', line 23 +# File 'lib/lyricli/sources/rdio.rb', line 27 def initialize @name = 'rdio' - @config = Lyricli::Configuration.instance - @rdio = Rdio::SimpleRdio.new([@config["rdio_key"], @config["rdio_secret"]], @config["rdio_auth_token"]) + @config = Configuration.instance + @rdio = ::Rdio::SimpleRdio.new([@config["rdio_key"], @config["rdio_secret"]], @config["rdio_auth_token"]) end
-46 -47 -48 -49 -50 51 52 53 @@ -439,19 +433,24 @@ token. 59 60 61 -62+62 +63 +64 +65 +66 +67
# File 'lib/lyricli/sources/rdio.rb', line 46 +# File 'lib/lyricli/sources/rdio.rb', line 51 def self.create_auth_token - @rdio = Rdio::SimpleRdio.new([@config["rdio_key"], @config["rdio_secret"]], @config["rdio_auth_token"]) + rdio = ::Rdio::SimpleRdio.new([@config["rdio_key"], @config["rdio_secret"]], @config["rdio_auth_token"]) # Request Authorization puts "Follow this URL to authorize lyricli:" auth_url = rdio.begin_authentication('oob') puts auth_url - Launchy.open(auth_url) + ::Launchy.open(auth_url) # Request Code, Obtain Token print "Please type the authorization code: " @@ -501,18 +500,26 @@ source. In the case of Rdio it has to authenticate with OAuth. 17 18 19 -20+20 +21 +22 +23 +24
# File 'lib/lyricli/sources/rdio.rb', line 13 def self.enable # Validation Code - @config = Lyricli::Configuration.instance + @config = Configuration.instance unless @config["rdio_auth_token"] && !@config["rdio_auth_token"].empty? create_auth_token end + puts "***" + puts "Hello, rdio tends to be a bit aggressive and tends to have trouble with other sources. If you're having trouble, you can disable it temporarily. You will not have to reauthenticate." + puts "***" + end
-40 -41 -42+44 +45 +46 +47
# File 'lib/lyricli/sources/rdio.rb', line 40 +# File 'lib/lyricli/sources/rdio.rb', line 44 def self.reset - # Reset Code -end+ @config = Configuration.instance + @config.delete("rdio_auth_token") +end
-32 -33 -34 -35 36 -37+37 +38 +39 +40 +41
# File 'lib/lyricli/sources/rdio.rb', line 32 +# File 'lib/lyricli/sources/rdio.rb', line 36 def current_track response = @rdio.call('currentUser', {'extras' => 'lastSongPlayed'}) @@ -640,9 +649,9 @@ A hash containing the current `:song` and `:artist`.