jf-roku/components/liveTv/LoadSheduleTask.brs
Neil Burrows 6d757653da Linter: Consistent IF statement format
No parentheses.  Use THEN if it's a one line statement.  Don't use THEN if it's a block statement
2021-06-26 14:52:16 +01:00

41 lines
815 B
Plaintext

sub init()
m.top.functionName = "loadSchedule"
end sub
sub loadSchedule()
results = []
params = {
UserId: get_setting("active_user"),
SortBy: "startDate",
EnableImages: false
EnableTotalRecordCount: false,
EnableUserData: false
channelIds: m.top.channelIds
MaxStartDate: m.top.endTime,
MinEndDate: m.top.startTime
}
url = "LiveTv/Programs"
resp = APIRequest(url)
data = postJson(resp, FormatJson(params))
if data = invalid
m.top.schedule = results
return
end if
results = []
for each item in data.Items
program = createObject("roSGNode", "ScheduleProgramData")
program.json = item
results.push(program)
end for
m.top.schedule = results
end sub