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

Consider setting scripts_dir path relative to sponsorblock.lua's path? #34

Open
lainiwa opened this issue Apr 27, 2021 · 1 comment
Open

Comments

@lainiwa
Copy link

lainiwa commented Apr 27, 2021

I am using a following mpv config layout:

~/.config/mpv/
├── input.conf
└── scripts/
   ├── modules.lua    <-- loads scripts from sub-folders
   ├── mpv_sponsorblock/
   │  ├── LICENSE
   │  ├── README.md
   │  ├── sponsorblock.lua
   │  └── sponsorblock_shared/...
   ├── ...
   └── ...

It however doesn't work with mpv_sponsorblock, as sponsorblock.lua is making assumption it was unpacked into the root of scripts/ folder.

Can scripts_dir variable be set to something like

scripts_dir = debug.getinfo(1).source:match("@?(.*/)")

so that it would be a bit more flexible?

@lucy
Copy link

lucy commented Dec 2, 2021

Would be better to rename the script to main.lua, move the contents of sponsorblock_shared to the root of the repo and use mp.get_script_directory().

Like this: https://github.com/lucy/mpv_sponsorblock/commit/e0206e132b12f1bb0143afb72325a4d014a40be8

That way you can just clone the repo into your mpv scripts directory.

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

No branches or pull requests

2 participants