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

What happened to extensions, why did they get so bloated? #118

Closed
nobef opened this issue Dec 23, 2024 · 8 comments
Closed

What happened to extensions, why did they get so bloated? #118

nobef opened this issue Dec 23, 2024 · 8 comments

Comments

@nobef
Copy link

nobef commented Dec 23, 2024

I have had 2 files conf and lua for a long time, everything works on the latest version of mpv. And here everyone offers to download a whole repository (via Git, what is it?)
I would like to know where this is going, or at least a visual video of what changes.

@CogentRedTester
Copy link
Owner

File-browser was changed to a directory script in #100. You can read that PR for the reasoning.

You can still get the old single-file version of the script in the mpv-v0. 31 branch, but it's not receiving any new feature updates, and barely any bug fixes. You can see the list of changes that have happened since becoming a directory script here: 398c188...master. This list will grow in the future, and many add-ons will end up requiring the newer versions.

git is the version control software that Github is built on. It allows you to easily make a local copy of a repo and pull changes. It's how I'd recommend managing this script, but if you don't know how to use it, just download the zip file and extract the files manually.

@nobef
Copy link
Author

nobef commented Dec 24, 2024

@CogentRedTester
Thanks for the patient and detailed answer, I'll try to figure it out. I just wanted to update this extension and download another one, but there don't seem to be any files there at all... mpv.cut

@CogentRedTester
Copy link
Owner

This is the relevant section of the manual I linked:

If a script is a directory (either if a directory is passed to --script, or any sub-directories in the script directory, such as for example ~/.config/mpv/scripts/something/), then the directory represents a single script. The player will try to load a file named main.x, where x is replaced with the file extension. For example, if main.lua exists, it is loaded with the Lua scripting backend.

So you need to copy the whole repository into a folder inside the ~~/scripts/ directory. That repository that you linked contains a main.lua file just like file-browser does.

Directory scripts were only added to MPV a few years ago, so it's taken a while for scripts to start using the feature. They provide numerous benefits to the authors of more complex scripts, and can make updating scripts much easier for users that know how to use git.

In the case of file-browser, it's not that it became more bloated, it's that all the code that previously existed in a single file had been split into multiple. This makes the code easier to read, understand, update, and maintain, which benefits everyone. It also means that scripts that do need extra files, like that script you linked with its utils file, has less complex installation instructions as they get installed alongside the script.

Another benefit is that documentation gets installed alongside the script (the README and docs folder) so you don't need to go looking online for the documentation for your specific script version.

@nobef
Copy link
Author

nobef commented Dec 24, 2024

@CogentRedTester
I tried it, only the basic functions work. I couldn’t upload via Git because there is no direct link to the repository 💀
I downloaded all the files and figured out the conf. As a result, such an error
image

We need at least a hint with folder and file structures, like here videoclip
Here in the picture
image

@nobef
Copy link
Author

nobef commented Dec 24, 2024

@CogentRedTester
I figured out the errors on the screenshot. Then I didn't delete the old file-browser.lua. But I would like to know the complete folder structure

@nobef
Copy link
Author

nobef commented Dec 24, 2024

@CogentRedTester
I have it like this
image
image
I would like additional buttons, configure/disable
And exclude file type such as image etc.
Yesterday I seemed to understand that you can disable it here in the settings. I was previously looking for a solution in autoload.conf

@CogentRedTester
Copy link
Owner

Sorry for the long delay, I was on holiday.

I figured out the errors on the screenshot. Then I didn't delete the old file-browser.lua. But I would like to know the complete folder structure

I have updated the README to show the expected file structure.

I would like additional buttons, configure/disable

I don't know what you mean by this.

And exclude file type such as image etc.

Add the file extensions you don't like to the extension_blacklist script-opt in file_browser.conf. E.g.:

extension_blacklist=jpg,png,gif

@CogentRedTester
Copy link
Owner

Closed due to inactivity.

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