diff --git a/locale/en_GB/translations.ts b/locale/en_GB/translations.ts index 9a407080..2e0ee567 100644 --- a/locale/en_GB/translations.ts +++ b/locale/en_GB/translations.ts @@ -382,5 +382,10 @@ Enter the server name or ip address Title of KeyboardDialog when manually entering a server URL + + ...or enter server URL manually: + …or enter server URL manually: + Instructions on initial app launch when the user is asked to manually enter a server URL + diff --git a/source/api/UserLibrary.brs b/source/api/UserLibrary.brs index 48e86c1e..f0ffafd4 100644 --- a/source/api/UserLibrary.brs +++ b/source/api/UserLibrary.brs @@ -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) diff --git a/source/api/baserequest.brs b/source/api/baserequest.brs index 21faa3f4..65803a98 100644 --- a/source/api/baserequest.brs +++ b/source/api/baserequest.brs @@ -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)