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

enable loading from global scripts dir #66

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

Conversation

robertgzr
Copy link

the scripts_dir detection logic uses mp.find_config_file("scripts") which
returns $XDG_CONFIG_HOME/mpv/scripts even if the plugin is installed globally
under /etc/mpv/scripts.

fix this by using mp.get_script_directory(), which requires the install the
plugin in a script directory, but that is recommended anyway for plugins like
this one: https://mpv.io/manual/master/#script-location

the scripts_dir detection logic uses `mp.find_config_file("scripts")` which
returns `$XDG_CONFIG_HOME/mpv/scripts` even if the plugin is installed globally
under `/etc/mpv/scripts`.

fix this by using `mp.get_script_directory()`, which requires the install the
plugin in a `script directory`, but that is recommended anyway for plugins like
this one: https://mpv.io/manual/master/#script-location

Signed-off-by: Robert Günzler <[email protected]>
@robertgzr
Copy link
Author

i guess this kind of depends on #17

@po5
Copy link
Owner

po5 commented May 5, 2023

Wouldn't mp.find_config_file("scripts/sponsorblock_shared") work as well?
I'd like to keep support for mpv <0.33.0 if it doesn't add complexity.

@robertgzr
Copy link
Author

yeah that seems to work as well...

@nbraud
Copy link

nbraud commented May 1, 2024

I'd like to keep support for mpv <0.33.0 if it doesn't add complexity.

Out of curiosity, is there a particular reason? Glancing through Repology, mpv 0.33 (or later) seems to be in all currently-supported releases of all major software distributions.

I'm asking because it adds some complexity downstream instead, both for users who manually clone the repo and copy/symlink files into place, and for distro packagers; granted, IDK of anyone packaging mpv scripts outside of us in nixpkgs.

nbraud added a commit to nbraud/mpv_sponsorblock that referenced this pull request May 1, 2024
This is the most platform-independent way, and fixes things
for users who have a global scripts directory. (see po5#66)

Closes po5#17
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.

None yet

3 participants