kwaschny / unwanted-twitch

Hide unwanted streams, games, categories and channels on: twitch.tv
https://kwaschny.net
MIT License
102 stars 13 forks source link

Feature request: Case sensitive matching #86

Closed sublimal closed 2 years ago

sublimal commented 2 years ago

I'd like to add a regex title blacklist to remove streams with only capitals (+ whitespace, punctuation, emojis). Random examples grabbed from directory:

  • MADISON 😱😱😱 FIRST TIME PLAYTHROUGH, MINIMAL BACKSEATING. | V RISING SOOOON | TSHIRT !COMPETITION
  • 💀CLICK NOW💀 BIG THINGS💀OMG💀BIG JUICE💀BIG NEWS💀 BIG REACT💀BIG GAMEPLAY💀U WONT BELIEVE WHAT HAPPENED💀NERVOUS ABOUT💀TOMORROW?💀WOW💀
  • THIS HACK IS INSANE - BARON OF SHELL CONTINUED - CRASH MARATHON CONITNUES TONIGHT
  • UNBREAKABLE WILL POWER AND AN INCONCEIVABLE GRIT

I can write the regular expression for this but all stored blacklist items and twitch element items are internally converted to lowercase before comparison.

kwaschny commented 2 years ago

Reasonable use case. I still want it to be case-insensitive by default though, so I guess we just invent a new flag to make the RegExp go back to case-sensitive, when needed. What could possibly go wrong?

How about uppercase iI? That would be: /^[^a-z]+$/I for blocking all channels not using any lowercase letters.

sublimal commented 2 years ago

That was my first inclination. And while I don't support the hack, I'm not against it - so long as it's documented (eg: in the TitlesExplainedText/help).

kwaschny commented 2 years ago

e2e7bc335eede57c8fa8bb49e4d3579382368e1b will be part of the next regular update. If you want early access to the new feature, you need to sideload the extension manually.

sublimal commented 2 years ago

Thanks. I added commit comments regarding the eng i18n that were a little off. If I get some spare cycles I'll try and sideload to test, but visually the commit looks accurate and I suspect you've already done testing.