Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[search_menu] Support titles in playlists #11

Open
pintassilgo opened this issue Jan 10, 2023 · 2 comments
Open

[search_menu] Support titles in playlists #11

pintassilgo opened this issue Jan 10, 2023 · 2 comments

Comments

@pintassilgo
Copy link

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
@stax76
Copy link
Owner

stax76 commented Jan 15, 2023

Thanks, I changed it.

There is a new project which replaces search_menu:

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

@stax76 stax76 closed this as completed Jan 15, 2023
@pintassilgo
Copy link
Author

pintassilgo commented Jan 16, 2023

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

@stax76 stax76 reopened this Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants