mpv-scripts
mpv-scripts copied to clipboard
[search_menu] Support titles in playlists
mpv supports playlists like this (.m3u file):
#EXTM3U
#EXTINF:0,This is the title of the item
https://example.com/file.mp4
In this example, search_menu currently can only find "file.mp4", but should use "This is the title of the item" instead.
search_menu should prefer playlist/N/title, using playlist/N/filename only as fallback if there's no title.
Suggested fix:
- local filename = mp.get_property("playlist/" .. i .. "/filename")
+ local name = mp.get_property("playlist/" .. i .. "/title")
+ if name == nil then
+ name = mp.get_property("playlist/" .. i .. "/filename")
+ end
Thanks, I changed it.
There is a new project which replaces search_menu:
https://github.com/stax76/mpv-scripts#command_palette
There is a new project which replaces search_menu
Great, thanks!
I currently use both your search_menu and CogentRedTester's search-page.lua because I see some advantages in each. I also keep one eye on the beautiful M-x, from which you inherited the visual for command_palette.
command_palette is an improved combination of search_menu and M-x, I'll use it with search-page.lua which still have some advantages.
A few suggestions, just leaving them here as ideas:
- Support keys
Home,End,PgUpandPgDownto quickly navigate menu items whenUpandDownare too slow. - I like the tabled view of
search-page.lua, "columns" vertically aligned likeshortcut | command | commentcombined with smart use of colors make the list easy to read. - Create option to filter out inactive/shadowed keybindings from results.
- Display current value for options and properties directly in menu list.
search-page.luadoes that. - Display types (string, choice...) and acceptable values for commands and options/properties (again
search-page.luais a good reference). - Display chapter time in chapters list.
Edit: and two minor things I miss from search_menu:
- Fuzzy search (example:
shift upfindsshift+upinsearch_menu, but returns nothing incommand_palette). - This one is very minor:
search_menuhighlights the searched chars in each result. Look how it's colored in green: