2021-07-09 20:08:32 +00:00
|
|
|
function MarkItemFavorite(id as string)
|
2023-06-01 12:43:27 +00:00
|
|
|
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)
|
2023-06-01 12:43:27 +00:00
|
|
|
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()
|
2023-06-01 12:43:27 +00:00
|
|
|
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 }))
|
2021-06-26 10:18:09 +00:00
|
|
|
end sub
|
2019-03-14 03:01:05 +00:00
|
|
|
|
2021-07-09 20:08:32 +00:00
|
|
|
function UnmarkItemWatched(id as string)
|
2023-06-01 12:43:27 +00:00
|
|
|
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
|