mpv-scripts icon indicating copy to clipboard operation
mpv-scripts copied to clipboard

[search_menu] Support titles in playlists

Open pintassilgo opened this issue 2 years ago • 2 comments

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

pintassilgo avatar Jan 10 '23 04:01 pintassilgo

Thanks, I changed it.

There is a new project which replaces search_menu:

https://github.com/stax76/mpv-scripts#command_palette

stax76 avatar Jan 15 '23 08:01 stax76

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, PgUp and PgDown to quickly navigate menu items when Up and Down are too slow.
  • I like the tabled view of search-page.lua, "columns" vertically aligned like shortcut | command | comment combined 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.lua does that.
  • Display types (string, choice...) and acceptable values for commands and options/properties (again search-page.lua is a good reference).
  • Display chapter time in chapters list.

Edit: and two minor things I miss from search_menu:

  • Fuzzy search (example: shift up finds shift+up in search_menu, but returns nothing in command_palette).
  • This one is very minor: search_menu highlights the searched chars in each result. Look how it's colored in green: image

pintassilgo avatar Jan 16 '23 03:01 pintassilgo