Merge branch 'master' into login-screen-visiblity

This commit is contained in:
Neil Burrows 2021-11-14 15:31:28 +00:00 committed by GitHub
commit fc91237af9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 13 deletions

View File

@ -382,5 +382,10 @@
<translation>Enter the server name or ip address</translation>
<extracomment>Title of KeyboardDialog when manually entering a server URL</extracomment>
</message>
<message>
<source>...or enter server URL manually:</source>
<translation>or enter server URL manually:</translation>
<extracomment>Instructions on initial app launch when the user is asked to manually enter a server URL</extracomment>
</message>
</context>
</TS>

View File

@ -13,15 +13,10 @@ end function
sub MarkItemWatched(id as string)
date = CreateObject("roDateTime")
dateStr = stri(date.getYear()).trim()
dateStr += leftPad(stri(date.getMonth()).trim(), "0", 2)
dateStr += leftPad(stri(date.getDayOfMonth()).trim(), "0", 2)
dateStr += leftPad(stri(date.getHours()).trim(), "0", 2)
dateStr += leftPad(stri(date.getMinutes()).trim(), "0", 2)
dateStr += leftPad(stri(date.getSeconds()).trim(), "0", 2)
dateStr = date.ToISOString()
url = Substitute("Users/{0}/PlayedItems/{1}", get_setting("active_user"), id)
APIRequest(url, { "DatePlayed": dateStr })
req = APIRequest(url)
postVoid(req, FormatJson({ "DatePlayed": dateStr }))
end sub
function UnmarkItemWatched(id as string)

View File

@ -76,13 +76,20 @@ function getJson(req)
return json
end function
function postVoid(req, data = "" as string)
status = req.PostFromString(data)
if status = 200
return true
else
function postVoid(req, data = "" as string) as boolean
req.setMessagePort(CreateObject("roMessagePort"))
req.AddHeader("Content-Type", "application/json")
req.AsyncPostFromString(data)
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)