Skip to content

autoload.lua: add function and keybind to call script manually #16125

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dieEisdiele
Copy link

  • New function enables current instance of the script then calls
    find_and_add_entries()
  • Keybind has no default binding and calls the new function

Allows users who only want to run the autoload script occasionally to
set disabled=yes then call the script during playback by binding a
shortcut 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 the
start 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 is
unbound by default.

- New function enables current instance of the script then calls
  `find_and_add_entries()`
- Keybind has no default binding and calls the new function

Allows users who only want to run the autoload script occasionally to
set `disabled=yes` then call the script during playback by binding a
shortcut 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 the
start 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 is
unbound by default.
@dieEisdiele
Copy link
Author

Sorry for making the same pull request repeatedly! It's my first time making pull requests and I wasn't sure how to fix the capital letter in the commit title setting off a linting error.

@Dudemanguy
Copy link
Member

You don't need to close and open new PRs. You can just force push to the same branch and github will update it.

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

Successfully merging this pull request may close these issues.

2 participants