autoload.lua: add function and keybind to call script manually #16125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
find_and_add_entries()
Allows users who only want to run the autoload script occasionally to
set
disabled=yes
then call the script during playback by binding ashortcut in input.conf, e.g.:
ctrl+p script-binding autoload/enable ; show-text "Playlist loaded"
Without this change,
find_and_add_entries()
is only called at thestart of a file. This means that it is still possible to enable the
script during playback, but it requires forcing the current file to
restart, e.g.:
ctrl+p change-list script-opts append autoload-disabled=no ; playlist-play-index current
This method is more seamless and should not affect users who do not
want this functionality, as it does not add any events which will cause
find_and_add_entries()
to be called other than the keybind, which isunbound by default.