feat: filter reply

Closes #118

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-08 19:28:12 +08:00
parent 847f42fee3
commit ae16771b5e
5 changed files with 191 additions and 34 deletions

View File

@@ -67,7 +67,8 @@ class RecommendFilter {
if (exemptFilterForFollowed && isFollowed == true) {
return false;
}
if (banWords.isNotEmpty && RegExp(banWords).hasMatch(title)) {
if (banWords.isNotEmpty &&
RegExp(banWords, caseSensitive: false).hasMatch(title)) {
return true;
}
return false;

View File

@@ -180,6 +180,9 @@ class GStorage {
static String get banWordForRecommend =>
setting.get(SettingBoxKey.banWordForRecommend, defaultValue: '');
static String get banWordForReply =>
setting.get(SettingBoxKey.banWordForReply, defaultValue: '');
static int get minLikeRatioForRecommend =>
setting.get(SettingBoxKey.minLikeRatioForRecommend, defaultValue: 0);
@@ -517,6 +520,7 @@ class SettingBoxKey {
continuePlayingPart = 'continuePlayingPart',
cdnSpeedTest = 'cdnSpeedTest',
horizontalPreview = 'horizontalPreview',
banWordForReply = 'banWordForReply',
// Sponsor Block
enableSponsorBlock = 'enableSponsorBlock',