jf-roku/source/api/UserLibrary.bs

28 lines
902 B
Plaintext
Raw Normal View History

2021-07-09 20:08:32 +00:00
function MarkItemFavorite(id as string)
url = Substitute("Users/{0}/FavoriteItems/{1}", m.global.session.user.id, id)
2021-07-09 20:08:32 +00:00
resp = APIRequest(url)
return postJson(resp)
2019-03-13 02:09:17 +00:00
end function
2019-03-13 03:15:24 +00:00
2021-07-09 20:08:32 +00:00
function UnmarkItemFavorite(id as string)
url = Substitute("Users/{0}/FavoriteItems/{1}", m.global.session.user.id, id)
2021-07-09 20:08:32 +00:00
resp = APIRequest(url)
resp.setRequest("DELETE")
return getJson(resp)
2019-03-13 03:15:24 +00:00
end function
2019-03-14 03:01:05 +00:00
2021-07-09 20:08:32 +00:00
sub MarkItemWatched(id as string)
date = CreateObject("roDateTime")
2021-11-13 10:47:13 +00:00
dateStr = date.ToISOString()
url = Substitute("Users/{0}/PlayedItems/{1}", m.global.session.user.id, id)
2021-11-13 10:47:13 +00:00
req = APIRequest(url)
postVoid(req, FormatJson({ "DatePlayed": dateStr }))
end sub
2019-03-14 03:01:05 +00:00
2021-07-09 20:08:32 +00:00
function UnmarkItemWatched(id as string)
url = Substitute("Users/{0}/PlayedItems/{1}", m.global.session.user.id, id)
2021-07-09 20:08:32 +00:00
resp = APIRequest(url)
resp.setRequest("DELETE")
return getJson(resp)
2019-03-14 03:01:05 +00:00
end function