gotwalt / sonos

Control Sonos speakers with Ruby
MIT License
383 stars 77 forks source link

Add a way to queue Rdio tracks/albums. #30

Closed jasperla closed 10 years ago

jasperla commented 10 years ago

It turns out that Rdio has much more streaming options (i.e. things that cannot be queued, but only "Play Now"), this means that the method to add Rdio stuff to the queue only needs to deal with tracks and albums:

To add "Slow Dive" by "Young The Giant"

speaker.add_rdio_to_queue({
  :track => '42083055',
  :album => '3944937',
  :username => 'RDIO_USERNAME_HERE' })

To add "Young The Giant" their self-titled album

speaker.add_rdio_to_queue({
  :album => '510602',
  :username => 'RDIO_USERNAME_HERE',
  :type => 'album' })

Looking at the #add_spotify_to_queue and #add_spotify_to_queue methods they share some bits for building the didl_metadata, this will probably be refactored into a common helper method later when I look into implementing "Play Now" for Spotify/Rdio elements.