diff options
| author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2026-01-04 12:26:31 -0800 |
|---|---|---|
| committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2026-01-04 12:26:31 -0800 |
| commit | bb08ce440878522cd02a80e27de7f3e313b0ca00 (patch) | |
| tree | cfa4963b47350682afdc0af898ccc6f0504c37e2 | |
| parent | e159f263e788188f50829d2a76cdcbf4355f9a32 (diff) | |
| download | mpv-iptv-menu-bb08ce440878522cd02a80e27de7f3e313b0ca00.tar.gz mpv-iptv-menu-bb08ce440878522cd02a80e27de7f3e313b0ca00.tar.xz | |
reduce priority of series during search
| -rw-r--r-- | main.lua | 28 |
1 files changed, 10 insertions, 18 deletions
@@ -655,17 +655,13 @@ local function search_menu_options_build(options, t, path) local path = path or {} for _, v in ipairs(options) do - if not v.type then - goto continue - end - - if not t[v.type] then - t[v.type] = {} - end - local v = util.copy_table(v) v.path = path - t[v.type][#t[v.type]+1] = v + if v.type == 'group' and v.group_type ~= 'series' then + t.categories[#t.categories+1] = v + else + t.elements[#t.elements+1] = v + end -- contents of lazy-loaded groups should not be searchable if v.type == 'group' and not v.lazy then @@ -674,21 +670,17 @@ local function search_menu_options_build(options, t, path) search_menu_options_build( group_menu_options(v), t, path) end - - ::continue:: end end local function search_menu_options(options) - local t = {} + local t = {categories = {}, elements = {}} search_menu_options_build(options, t) - -- display categories before streams - local ret = t.group or {} - if t.stream then - for _, v in ipairs(t.stream) do - ret[#ret+1] = v - end + -- display categories first + local ret = t.categories + for _, v in ipairs(t.elements) do + ret[#ret+1] = v end return ret end |
