Skip to content

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.

end

local function enable()
o.disabled = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will leave it enabled. Wasn't the objective to just run it once on demand? And keep it disabled?

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.

3 participants