summaryrefslogtreecommitdiff
path: root/rt.lua
diff options
context:
space:
mode:
Diffstat (limited to 'rt.lua')
-rw-r--r--rt.lua27
1 files changed, 26 insertions, 1 deletions
diff --git a/rt.lua b/rt.lua
index d49c59d..f68d89f 100644
--- a/rt.lua
+++ b/rt.lua
@@ -628,7 +628,32 @@ local function search_text_transform(f, ...)
return
end
- menu:set_search_text(str, pos)
+ local term
+ local filter
+ local prefix
+ if str:sub(1,1) == '\\' then
+ term = str:sub(2)
+ else
+ prefix, term = str:match('^(.-)//(.*)')
+ term = term or str
+ end
+ if prefix then
+ local fc = prefix:find('c')
+ local fm = prefix:find('m')
+ local fs = prefix:find('s')
+ local fg = prefix:find('g')
+
+ filter = function(v)
+ return fc and (v.stream_type == 'live' or
+ v.stream_type == 'radio_streams') or
+ fm and v.stream_type == 'movie' or
+ fs and v.group_type == 'series' or
+ fg and v.type == 'group' and
+ v.group_type ~= 'series'
+ end
+ end
+
+ menu:set_search_text(str, pos, term, filter)
osd:dirty()
end