2020-11-23 17:13:57 +00:00
|
|
|
sub init()
|
|
|
|
m.top.functionName = "loadSchedule"
|
2021-07-09 20:08:32 +00:00
|
|
|
end sub
|
|
|
|
|
|
|
|
sub loadSchedule()
|
|
|
|
|
2020-11-23 17:13:57 +00:00
|
|
|
results = []
|
2021-07-09 20:08:32 +00:00
|
|
|
|
2020-11-23 17:13:57 +00:00
|
|
|
params = {
|
2021-07-09 20:08:32 +00:00
|
|
|
UserId: get_setting("active_user"),
|
|
|
|
SortBy: "startDate",
|
2022-05-30 12:59:24 +00:00
|
|
|
EnableImages: false,
|
2021-07-09 20:08:32 +00:00
|
|
|
EnableTotalRecordCount: false,
|
2022-05-30 12:59:24 +00:00
|
|
|
EnableUserData: false,
|
|
|
|
channelIds: m.top.channelIds,
|
2021-07-09 20:08:32 +00:00
|
|
|
MaxStartDate: m.top.endTime,
|
|
|
|
MinEndDate: m.top.startTime
|
2020-11-23 17:13:57 +00:00
|
|
|
}
|
2021-07-09 20:08:32 +00:00
|
|
|
|
2020-11-23 17:13:57 +00:00
|
|
|
url = "LiveTv/Programs"
|
|
|
|
|
2020-11-27 14:46:03 +00:00
|
|
|
resp = APIRequest(url)
|
2021-07-09 20:08:32 +00:00
|
|
|
data = postJson(resp, FormatJson(params))
|
|
|
|
|
2021-06-26 13:52:16 +00:00
|
|
|
if data = invalid
|
2020-11-23 17:13:57 +00:00
|
|
|
m.top.schedule = results
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
|
|
|
|
results = []
|
2021-07-09 20:08:32 +00:00
|
|
|
|
2020-11-23 17:13:57 +00:00
|
|
|
for each item in data.Items
|
2021-07-09 20:08:32 +00:00
|
|
|
program = createObject("roSGNode", "ScheduleProgramData")
|
|
|
|
program.json = item
|
2022-01-09 04:40:25 +00:00
|
|
|
' Are we currently recording this program?
|
2022-01-09 14:56:52 +00:00
|
|
|
if program.json.TimerId <> invalid and program.json.TimerId <> ""
|
2022-01-09 04:40:25 +00:00
|
|
|
program.hdSmallIconUrl = "pkg:/images/red.png"
|
2022-01-09 14:56:10 +00:00
|
|
|
else
|
|
|
|
program.hdSmallIconUrl = invalid
|
2022-01-09 04:40:25 +00:00
|
|
|
end if
|
2021-07-09 20:08:32 +00:00
|
|
|
results.push(program)
|
2020-11-23 17:13:57 +00:00
|
|
|
end for
|
|
|
|
|
2021-07-09 20:08:32 +00:00
|
|
|
|
2020-11-23 17:13:57 +00:00
|
|
|
m.top.schedule = results
|
2021-07-09 20:08:32 +00:00
|
|
|
|
2022-01-09 04:40:25 +00:00
|
|
|
end sub
|