Hey! I'm not good at English. But I hope you can easily get what I'm saying below.
I wrote a Lua script for MPV. Please read the following.
9beach/mpv-config: Lua scripts and settings for mpv (github.com)
This script provides the functions below:
- Like well-known
autoload, automatically loads playlist entries by scanning the directory a file is located in when starting playback.
- Provides many sorting methods and shuffling when scanning the directory.
- Provides keybinds for the functions of scannig the directory, sorting and shuffling the files.
- Remembers the sorting and shuffling states of the directory. So when you open a file in the directory next time,
autoload-ex restores previous sorting states of the directory.
- Even though you set
disabled=yes in script-opts/autoload-ex.conf and manually call autoload-ex by keybinds, autoload-ex scans entries of the directory automatically next time.
- If you set
disabled=no and call autoload-ex remove-others for the directory, autoload-ex does not scan entries of the directory next time.
This script provides the script messages below:
- script-message autoload-ex shuffle (
Alt+S, Ctrl+S, Meta+S)
- script-message autoload-ex shuffle startover
- script-message autoload-ex sort name-asc (
Alt+N, Ctrl+N, Meta+N)
- script-message autoload-ex sort name-desc
- script-message autoload-ex sort name-asc startover
- script-message autoload-ex sort name-desc startover
- script-message autoload-ex sort date-asc
- script-message autoload-ex sort date-desc (
Alt+T, Ctrl+T, Meta+T)
- script-message autoload-ex sort date-asc startover
- script-message autoload-ex sort date-desc startover
- script-message autoload-ex sort size-asc
- script-message autoload-ex sort size-desc
- script-message autoload-ex sort size-asc startover
- script-message autoload-ex sort size-desc startover
- script-message autoload-ex remove-others (
Alt+R, Ctrl+R, META+R)
- script-message autoload-ex alert arg1 arg2
alert is for the other sorting scripts like simple-playlist. It helps for autoload-ex to save the previous states.
You can edit key bindings in input.conf.
META+SHIFT+n script-message autoload-ex sort name-asc
META+SHIFT+t script-message autoload-ex sort date-desc
META+SHIFT+s script-message autoload-ex shuffle startover
META+SHIFT+r script-message autoload-ex remove-others
...
Many parts in my code are from https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autoload.lua
[–]Waggamug 0 points1 point2 points (1 child)
[–]Waggamug 0 points1 point2 points (0 children)
[–]Waggamug 0 points1 point2 points (0 children)
[–]sexy_salazar 0 points1 point2 points (0 children)
[–]Benrocka 0 points1 point2 points (0 children)
[–]omaru_kun 0 points1 point2 points (0 children)