summaryrefslogtreecommitdiff
path: root/rt.lua
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2026-01-28 01:28:07 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2026-01-28 01:28:07 -0800
commitb29af502c800131a34c38a74d6e7be8da259deb2 (patch)
tree3bef0084c8ace76a19f71732b71d088819bef911 /rt.lua
parente3f3ef7e681890e2b7c20ad54177856a178e581f (diff)
downloadmpv-iptv-menu-b29af502c800131a34c38a74d6e7be8da259deb2.tar.gz
mpv-iptv-menu-b29af502c800131a34c38a74d6e7be8da259deb2.tar.xz
move cursor to next programme on gap in EPG
Diffstat (limited to 'rt.lua')
-rw-r--r--rt.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/rt.lua b/rt.lua
index 94c665b..f7474aa 100644
--- a/rt.lua
+++ b/rt.lua
@@ -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