summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua16
1 files changed, 15 insertions, 1 deletions
diff --git a/main.lua b/main.lua
index 64b2e0d..19875f0 100644
--- a/main.lua
+++ b/main.lua
@@ -89,7 +89,7 @@ local function set_key_mapping(m)
binding_state.active = binding_state.mappings[m]
end
-local function load_data()
+local function load_data(force)
local arr = {
{id = 'live', name = 'Live TV', type = 'live'},
{id = 'movie', name = 'Movies', type = 'vod'},
@@ -100,6 +100,7 @@ local function load_data()
local sect_str
local disp_str
local call_opts = {
+ force = not not force,
before_hit = function()
if disp_str ~= base_str and disp_str ~= sect_str then
osd:set_status(base_str .. '...')
@@ -1122,10 +1123,23 @@ local function mouse_click_right(ev)
open_option_info(menu.options[pos])
end
+local function reload_data()
+ if state.depth > 1 then
+ osd:flash_error('Can only reload data from root menu')
+ return
+ end
+
+ catalogue = _catalogue.new()
+ load_data(true)
+ state.depth = 0
+ push_group_menu(catalogue:get('root'))
+end
+
binding_state.mappings.MENU = {
['BS'] = {prev_menu},
['/'] = {start_search},
['Ctrl+s'] = {toggle_menu_sort},
+ ['Ctrl+R'] = {reload_data},
['ENTER'] = {select_option},
['Ctrl+f'] = {favourite_option},