From 2d3255abec72cb5a0eb540672b2adafff0d06d20 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 20 May 2025 06:32:46 -0700 Subject: add shortcut to go to currently playing stream --- main.lua | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/main.lua b/main.lua index 2938948..7d62c3b 100644 --- a/main.lua +++ b/main.lua @@ -907,6 +907,37 @@ local function goto_option() update_osd() end +local function goto_playing() + if not playing_id then + return + end + + local obj = objects[playing_id] + if not obj then + return + end + + local path = {} + local curr = obj + while curr.parent_id and curr.parent_id ~= 'root' and + objects[curr.parent_id] do + curr = objects[curr.parent_id] + path[#path+1] = curr + end + if #path == 0 or curr.parent_id ~= 'root' then + return + end + + depth = 1 + for i = #path, 1, -1 do + cursor_to_object(path[i].id) + push_group_menu(path[i]) + end + + cursor_to_object(obj.id) + update_osd() +end + local function open_epg_programme(prog) local options = { {name='Title: ' .. prog.title}, @@ -1313,6 +1344,7 @@ function bind_menu_keys() bind_key('Ctrl+f', favourite_option) bind_key('g', goto_option) bind_key('?', open_option_info) + bind_key('Ctrl+p', goto_playing) bind_key('UP', cursor_up, {repeatable=true}) bind_key('DOWN', cursor_down, {repeatable=true}) -- cgit v1.2.3-70-g09d2