Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tighter access to player methods

  • Loading branch information...
commit fa0c421da5c5dafd37daff325b18266d292c180e 1 parent e9e1c6d
@sunny authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 sonice.rb
View
11 sonice.rb
@@ -40,8 +40,15 @@ def artist_image(artist)
end
put '/player' do
- return unless settings.controls || settings.voting
- params.each { |k, v| $player.send(k) if $player.respond_to?(k) }
+ if settings.voting
+ $player.vote if params['vote']
+ end
+
+ if settings.controls
+ methods = %w(playpause prev next voldown volup) & params.keys
+ methods.each { |method| $player.send(method) }
+ end
+
if !request.xhr?
redirect '/'
end
Please sign in to comment.
Something went wrong with that request. Please try again.