mirror of
https://github.com/jellyfin/jellyfin-roku.git
synced 2024-12-18 19:46:41 +00:00
Import api roku module as a bsc namespace
This commit is contained in:
parent
0dd873c787
commit
8997b1fd02
@ -91,6 +91,39 @@ function postVoid(req, data = "" as string) as boolean
|
||||
return false
|
||||
end function
|
||||
|
||||
function headVoid(req) as boolean
|
||||
req.setMessagePort(CreateObject("roMessagePort"))
|
||||
req.AddHeader("Content-Type", "application/json")
|
||||
req.AsyncHead()
|
||||
resp = wait(30000, req.GetMessagePort())
|
||||
if type(resp) <> "roUrlEvent"
|
||||
return false
|
||||
end if
|
||||
|
||||
if resp.GetResponseCode() = 200
|
||||
return true
|
||||
end if
|
||||
|
||||
return false
|
||||
end function
|
||||
|
||||
function getVoid(req) as boolean
|
||||
req.setMessagePort(CreateObject("roMessagePort"))
|
||||
req.AddHeader("Content-Type", "application/json")
|
||||
req.AsyncGetToString()
|
||||
resp = wait(30000, req.GetMessagePort())
|
||||
|
||||
if type(resp) <> "roUrlEvent"
|
||||
return false
|
||||
end if
|
||||
|
||||
if resp.GetResponseCode() = 200
|
||||
return true
|
||||
end if
|
||||
|
||||
return false
|
||||
end function
|
||||
|
||||
function postJson(req, data = "" as string)
|
||||
req.setMessagePort(CreateObject("roMessagePort"))
|
||||
req.AddHeader("Content-Type", "application/json")
|
||||
@ -133,6 +166,23 @@ function get_url()
|
||||
return base
|
||||
end function
|
||||
|
||||
function getString(req)
|
||||
data = req.GetToString()
|
||||
return data
|
||||
end function
|
||||
|
||||
function postString(req, data = "" as string)
|
||||
req.setMessagePort(CreateObject("roMessagePort"))
|
||||
req.AddHeader("Content-Type", "application/json")
|
||||
req.AsyncPostFromString(data)
|
||||
resp = wait(30000, req.GetMessagePort())
|
||||
if type(resp) <> "roUrlEvent"
|
||||
return invalid
|
||||
end if
|
||||
|
||||
return resp.getString()
|
||||
end function
|
||||
|
||||
function authorize_request(request)
|
||||
user = get_setting("active_user")
|
||||
|
||||
|
2181
source/api/sdk.bs
Normal file
2181
source/api/sdk.bs
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user