Skip to content

Enhance the custom sub filter implementation#156

Merged
tatsumoto-ren merged 13 commits intoAjatt-Tools:masterfrom
mosaic-roll:better-custom-filter
Feb 11, 2026
Merged

Enhance the custom sub filter implementation#156
tatsumoto-ren merged 13 commits intoAjatt-Tools:masterfrom
mosaic-roll:better-custom-filter

Conversation

@mosaic-roll
Copy link
Copy Markdown
Contributor

@mosaic-roll mosaic-roll commented Feb 7, 2026

This PR improves the custom_sub_filter feature merged in #151 with the following changes:

  1. Relocated Plugin Directory: Moved subs2srs_sub_filter from ~/.config/mpv/ to ~/.config/mpv/scripts/.
    It now follows the standard mpv plugin structure (including a placeholder main.lua), making it easier to manage within the standard scripts environment.
    Note: The logic remains in subs2srs_sub_filter.lua rather than main.lua because this is a specialized module dedicated to mpvacious rather than a standalone mpv script.

  2. Extended Customization via init(): The subs2srs_sub_filter.lua now returns an init() function. This allows users to define their own logic, such as registering custom hotkeys.

  3. Cleanup: Removed redundant or unnecessary configuration parameters to simplify the codebase.

@tatsumoto-ren
Copy link
Copy Markdown
Member

tatsumoto-ren commented Feb 8, 2026

@mosaic-roll
Copy link
Copy Markdown
Contributor Author

Hi, Tatsumoto,
I noticed that this branch was force pushed, and there seem to be some unexpected changes.

This file needs to be updated https://github.com/Ajatt-Tools/mpvacious/blob/master/.github/RELEASE/custom_sub_filter_example.lua

What I had added in my own script basically was:

M.init = function()
    mp.add_key_binding("alt+m", "toggle_my_filter", toggle_enabled)
end

Sorry, I don't have my computer with me today.

@tatsumoto-ren
Copy link
Copy Markdown
Member

tatsumoto-ren commented Feb 9, 2026

I noticed that this branch was force pushed, and there seem to be some unexpected changes.

I only rebased your branch on top of the master branch. I didn't edit anything else.

What I had added in my own script basically was:

It would be great if we could provide an example script with all the necessary instructions on how to set it up.

@tatsumoto-ren
Copy link
Copy Markdown
Member

Previously, all documentation lived in subs2srs.conf. Since that section was removed, the documentation is gone. To fix this, please add a section to README.md explaining how to use custom subtitle filters.

@mosaic-roll
Copy link
Copy Markdown
Contributor Author

I initially chose custom_sub_filter for brevity, but I’ve realized that using the full word subtitle (e.g., custom_subtitle_filter) would be more explicit and sounds better. Since the feature isn't widely used yet, would it be okay to rename all these *_sub_filter things to *_subtitle_filter?

@tatsumoto-ren
Copy link
Copy Markdown
Member

would it be okay to rename all these?

yes, sure.

@tatsumoto-ren tatsumoto-ren merged commit e1426a5 into Ajatt-Tools:master Feb 11, 2026
@mosaic-roll mosaic-roll deleted the better-custom-filter branch February 12, 2026 06:21
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