soffes/sonos — pull request #30 by jasperla (2014-02-04 20:37:31+00:00)
Title: Add a way to queue Rdio tracks/albums.

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({
:key_1 => '42083055',
:key_2 => '3944937',
:username => 'RDIO_USERNAME_HERE' })
````

To add "Young The Giant" their self-titled album
````
speaker.add_rdio_to_queue({
:key_2 => '510602',
:username => 'RDIO_USERNAME_HERE',
:type => 'album' })
````

Currently `key_1` and `key_2` are pretty non-saying identifiers, perhaps they should be made type dependant, to something like:
`````
speaker.add_rdio_to_queue({:username => 'bla', :type => 'album', :album = '1234' })
speaker.add_rdio_to_queue({:username => 'bla', :type => 'track', :album = '1234', :track => '4321' })
````

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.