Skip to content

Commit

Permalink
Fix for Frodo nightlits as of 31/12/2012
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean Vizer committed Oct 31, 2012
1 parent 9240b07 commit bc67ed6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/xbmc_library.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def xbmc(method, params={})
# Raw API interaction: Invoke the given JSON RPC Api call and return the raw response (which is an instance of
# HTTParty::Response)
def invoke_json_method(method, params={})
response = self.class.post('/jsonrpc', :body => {"jsonrpc" => "2.0", "params" => params, "id" => "1", "method" => method}.to_json)
raise XBMCLibrary::UnauthorizedError, "Could not authorize with XBMC. Did you set up the correct user name and password ?" if response.response.class == Net::HTTPUnauthorized
response = self.class.post('/jsonrpc', :body => {"jsonrpc" => "2.0", "params" => params, "id" => "1", "method" => method}.to_json,:headers => { 'Content-Type' => 'application/json' } )
raise XBMCLibrary::UnauthorizedError, "Could not authorize with XBMC. Did you set up the correct user name and password ?" if response.response.class == Net::HTTPUnauthorized
response

# Capture connection errors and send them out with a custom message
Expand Down

1 comment on commit bc67ed6

@Deanmv
Copy link
Owner

@Deanmv Deanmv commented on bc67ed6 Oct 31, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Courtesy of wendelit at brainwave9#6

Please sign in to comment.