class Robut::Plugin::Rdio::Server

A simple server to communicate new Rdio sources to the Web Playback API. The client will update Robut::Plugin::Rdio::Server.queue with any new sources, and a call to /queue.json will pull those new sources as a json object.

Attributes

command[RW]

A command list for the player to execute

domain[RW]

The domain associated with token. Defaults to localhost.

last_played_track[RW]
queue[RW]

A list of items that haven’t been fetched by the web playback API yet.

reply_callback[RW]

A callback set by to Robut plugin so the server can talk to it

state_callback[RW]

A callback for Hipchat Chat room to set the state of the robut

token[RW]

The playback token for domain. If you’re accessing Rdio over localhost, you shouldn’t need to change this. Otherwise, download the rdio-python plugin:

https://github.com/rdio/rdio-python

and generate a new token for your domain:

./rdio-call --consumer-key=YOUR_CONSUMER_KEY --consumer-secret=YOUR_CONSUMER_SECRET getPlaybackToken domain=YOUR_DOMAIN

Public Instance Methods

announce!(message) click to toggle source
# File lib/server/server.rb, line 95
def announce!(message)
  self.class.reply_callback.call(message) if self.class.reply_callback
end
state!(message) click to toggle source
# File lib/server/server.rb, line 91
def state!(message)
  self.class.state_callback.call(message) if self.class.state_callback
end
track_is_not_the_same_as_last?(current_track) click to toggle source
# File lib/server/server.rb, line 99
def track_is_not_the_same_as_last? current_track
  self.class.last_played_track != current_track
end