diff options
| -rw-r--r-- | rt.lua | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -661,7 +661,7 @@ local function open_option_epg(opt) end local options = {} - local curr = 0 + local idx local time = os.time() for i, v in ipairs(progs) do local prog = { @@ -671,12 +671,13 @@ local function open_option_epg(opt) programme = v, } - if curr == 0 and time >= v.start and time < v.stop then - curr = i + if not idx and time < v.stop then + idx = i end options[i] = setmetatable(prog, epg_programme_mt) end + idx = idx or #options local menu = state:push_menu({ options = options, @@ -686,7 +687,7 @@ local function open_option_epg(opt) if opt.img_url then menu.img_url = opt.img_url end - rt.set_cursor(curr, {centre = true}) + rt.set_cursor(idx, {centre = true}) osd:dirty() end |
