radamant / robut-rdio Goto Github PK
View Code? Open in Web Editor NEWA client/server RDIO plugin for Robut
License: MIT License
A client/server RDIO plugin for Robut
License: MIT License
Robut-rdio required robut-rdio on gem install
...............FF
Failures:
1) Robut::Plugin::Rdio::Server should be able to tell HipChat what song is playing
Failure/Error: last_response.should be_ok
expected ok? to return true, got false
# ./spec/server_spec.rb:19:in `block (2 levels) in <top (required)>'
2) Robut::Plugin::Rdio::Server should degrade gracefully if a reply_callback has not been defined
Failure/Error: last_response.should be_ok
expected ok? to return true, got false
# ./spec/server_spec.rb:26:in `block (2 levels) in <top (required)>'
Finished in 0.51483 seconds
17 examples, 2 failures
@dj find radio head
should find only songs that match 'radio head'
@dj find album stop making sense
should find albums matching 'stop making sense'
bonus:
@dj find songs by herbie hancock
@dj find albums by herbie hancock
@dj set find to default to album
A user is able to set the default find
request to the currently available Rdio search criteria artist, album, track.
@dj play willy wonka
This soundtrack has a forward slash in it's name so it will result in generating a poorly defined path when reporting what is now playing.
This appears to have been broken since defaulting searches to tracks.
Another feature...
Or something of that sort that might return results chronologically by release as oppose to what i'm guessing is a sort by popularity.
frank > @dj find little richard
dj > Results ..
0...
...
10...
adam > @dj play @frank 0
if (!callbackObject.playing) {
element.rdio_play(data[0]);
data = data.slice(1);
}
When querying the queue if the the player is not playing it will immediately replace the current playing track with the new one being queued.
To resolve this we should likely only start playing when we are stopped and the queue is empty. Not simply just not playing.
@dj find panthalassa
@dj play 1
Expect it to either say "search results are no longer available; try your search again" or to persist the last results across sessions.
Stack Trace (at 85fdc12):
undefined method `[]' for nil:NilClass (NoMethodError)
robut-rdio-0.1.0/lib/results_manager.rb:24:in `results_for'
robut-rdio-0.1.0/lib/actions/play_results_action.rb:70:in `results_for'
robut-rdio-0.1.0/lib/actions/play_results_action.rb:50:in `handle'
robut-rdio-0.1.0/lib/robut-rdio.rb:117:in `handle'
Frank > @wolfman find artist breeders
Wolfman > Opps! I crashed....
This is making a call to Rdio and asking for Artists, however this may not have been implemented right or the value is not supported.
Steps To Reproduce
This does not happen if Rdio is currently playing a track.
I keep getting a jQuery null ref exception whenever it queues up the first song:
Uncaught Error: Error calling method on NPObject.
d.extend._Deferred.f.resolveWith jquery.min.js:16
v jquery.min.js:16
d.support.ajax.d.ajaxTransport.send.c jquery.min.js:16
When an album is queued the album ID is queued so it appears as one item when being played. We could solve this issue by not enqueuing the album by ID but all the tracks from the album.
callback.playingTrackChanged = function(playingTrack, sourcePosition) {
if (playingTrack) {
var title = callback.sourceTitle(playingTrack);
$('#now_playing li').removeClass('playing');
$('#now_playing li').eq(sourcePosition).addClass('playing');
$('title').html(title + " - Powered by Rdio");
$('#current_track').show().html("Now Playing: " + title);
$.ajax({
url: '/now_playing/' + escape(title),
dataType: 'json'
});
} else {
$('#current_track').hide();
}
}
This block seems to be called twice whenever a track changes.
When the user requests to play multiple tracks, Robut will respond each time for each of the tracks. For something like play all
this can be a large wall of text.
ArgumentError - invalid byte sequence in UTF-8: /Users/burtlo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/common.rb:230:in
gsub'
/Users/burtlo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/common.rb:230:in unescape' /Users/burtlo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/common.rb:531:in
unescape'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/robut-rdio-0.1.0/lib/server/server.rb:72:in block in <class:Server>' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:1212:in
call'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:1212:in block in compile!' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:772:in
[]'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:772:in block (3 levels) in route!' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:788:in
route_eval'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:772:in block (2 levels) in route!' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:821:in
block in process_route'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:819:in catch' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:819:in
process_route'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:771:in block in route!' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:770:in
each'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:770:in route!' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:886:in
dispatch!'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:706:in block in call!' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:871:in
block in invoke'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:871:in catch' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:871:in
invoke'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:706:in call!' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:692:in
call'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/rack-protection-1.1.4/lib/rack/protection/xss_header.rb:22:in call' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/rack-protection-1.1.4/lib/rack/protection/path_traversal.rb:16:in
call'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/rack-protection-1.1.4/lib/rack/protection/json_csrf.rb:17:in call' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/rack-protection-1.1.4/lib/rack/protection/base.rb:47:in
call'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/rack-protection-1.1.4/lib/rack/protection/xss_header.rb:22:in call' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/rack-1.3.5/lib/rack/nulllogger.rb:9:in
call'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/rack-1.3.5/lib/rack/head.rb:9:in call' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/showexceptions.rb:21:in
call'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:1334:in block in call' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:1403:in
synchronize'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/sinatra-1.3.1/lib/sinatra/base.rb:1334:in call' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/thin-1.2.11/lib/thin/connection.rb:84:in
block in pre_process'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/thin-1.2.11/lib/thin/connection.rb:82:in catch' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/thin-1.2.11/lib/thin/connection.rb:82:in
pre_process'
/Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/eventmachine-0.12.10/lib/eventmachine.rb:1060:in call' /Users/burtlo/.rvm/gems/ruby-1.9.2-p290@robut-rdio/gems/eventmachine-0.12.10/lib/eventmachine.rb:1060:in
block in spawn_threadpool'`
Rdio server will return to the user results that contain sample versions or versions that are not playable. These should be removed from the results to ensure that the playback experience is premium.
play CCR!
Frank > @wolfman find breeders - last splash
Wolfman > 0: The Breeders - Last Splash - Cannonball
1: The Breeders - Last Splash - No Aloha
2: The Breeders - Last Splash - Divine Hammer
3: The Breeders - Last Splash - New Year
4: The Breeders - Last Splash - Invisible Man
5: The Breeders - Last Splash - Roi
6: The Breeders - Last Splash - Flipsiide
7: The Breeders - Last Splash - I Just Wanna Get Along
8: The Breeders - Last Splash - Saints
9: The Breeders - Last Splash - S.O.S.
Frank > @wolfman play 1, 2, 8
Frank > @wolfman play 3-4 7-9
User is able to queue multiple results at the same time using commas as a separator and dashes to represent ranges.
Frank > @wolfman play all results
User is able to queue all the results that were returned in a single command
Given the rdio has played the following songs:
| artist | album | track |
| Radiohead | OK Computer | No alarms and no surprises |
| Beastie Boys | Sabatoge | Sabotage |
| Liam Lynch | Fake Songs | United States of Whatever |
When I send the message:
| @dj show me the last 2 songs |
Then I should see the following songs in the history results:
| Liam Lynch | Fake Songs | United States of Whatever |
| Beastie Boys | Sabatoge | Sabotage |
Currently the search results for an artist - album will show the first 10 tracks in the results. Tracks that are higher are not visible.
It would be useful to be able to see the next set of results
user > @dj find beatles white album
dj > results....
0...
...
10...
user > @dj more
dj > results ...
11...
...
20...
This would find the next 10 results to show but start counting out from 11 to 20.
Given the rdio has queued the following songs:
| artist | album | track |
| Radiohead | OK Computer | No alarms and no surprises |
| Beastie Boys | Sabatoge | Sabotage |
| Liam Lynch | Fake Songs | United States of Whatever |
When I send the message:
| @dj show me the queue |
Then I should see the following songs in the history results:
| Radiohead | OK Computer | No alarms and no surprises |
| Beastie Boys | Sabatoge | Sabotage |
| Liam Lynch | Fake Songs | United States of Whatever |
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.