DrKain / subclean

A cross-platform CLI tool and node module to remove advertising from subtitles. Supports Bazarr and bulk cleaning!
MIT License
55 stars 5 forks source link

remove chained ads in case of regex-filter hit #20

Closed Eytan414 closed 2 years ago

Eytan414 commented 2 years ago

I'm not really familiar with subtitles ads so I was working under the assumption that only the regex based filter yields a hit of chained nodes, so my solution is applied only for those cases.

I can also expand it to rest of the cases, my initial thought is to hold a node hit index array, and apply the fix for all those indexes right after the blacklist loop.

DrKain commented 2 years ago

Thanks for this. I'll need to do some testing locally before anything is merged.
If you wouldn't mind, could you please set up a custom arg for this functionality? Seeing as it's an experimental feature I'd prefer it not to be enabled by default.

Eytan414 commented 2 years ago

Thanks for this. I'll need to do some testing locally before anything is merged. If you wouldn't mind, could you please set up a custom arg for this functionality? Seeing as it's an experimental feature I'd prefer it not to be enabled by default.

Yes, I'll push an update soon

DrKain commented 2 years ago

Ended up changing a few things around, mostly var names and extra logging but it should be available in the 1.5.0 release published a moment ago.
You've been credited in the release notes too, thank you for the contribution.

Eytan414 commented 2 years ago

Yes I just saw, thank you! I didn't like the name too, and as for the other changes they're really helpful for maintainability - great library