mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 01:26:59 +08:00
opt filter dyn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -13,6 +13,14 @@ class DynamicsDataModel {
|
|||||||
String? offset;
|
String? offset;
|
||||||
int? total;
|
int? total;
|
||||||
|
|
||||||
|
static String _getMatchText(DynamicItemModel item) {
|
||||||
|
final moduleDynamic = item.modules.moduleDynamic;
|
||||||
|
final opus = moduleDynamic?.major?.opus;
|
||||||
|
return (opus?.title ?? '') +
|
||||||
|
(opus?.summary?.text ?? '') +
|
||||||
|
(moduleDynamic?.desc?.text ?? '');
|
||||||
|
}
|
||||||
|
|
||||||
static RegExp banWordForDyn = RegExp(
|
static RegExp banWordForDyn = RegExp(
|
||||||
Pref.banWordForDyn,
|
Pref.banWordForDyn,
|
||||||
caseSensitive: false,
|
caseSensitive: false,
|
||||||
@@ -42,16 +50,15 @@ class DynamicsDataModel {
|
|||||||
'ADDITIONAL_TYPE_GOODS')) {
|
'ADDITIONAL_TYPE_GOODS')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (enableFilter &&
|
if (enableFilter) {
|
||||||
banWordForDyn.hasMatch(
|
if (item.orig case DynamicItemModel orig) {
|
||||||
(item.orig?.modules.moduleDynamic?.major?.opus?.summary?.text ??
|
if (banWordForDyn.hasMatch(_getMatchText(orig))) {
|
||||||
'') +
|
continue;
|
||||||
(item.modules.moduleDynamic?.major?.opus?.summary?.text ??
|
}
|
||||||
'') +
|
}
|
||||||
(item.orig?.modules.moduleDynamic?.desc?.text ?? '') +
|
if (banWordForDyn.hasMatch(_getMatchText(item))) {
|
||||||
(item.modules.moduleDynamic?.desc?.text ?? ''),
|
continue;
|
||||||
)) {
|
}
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if (filterBan &&
|
if (filterBan &&
|
||||||
tempBannedList!.contains(item.modules.moduleAuthor?.mid)) {
|
tempBannedList!.contains(item.modules.moduleAuthor?.mid)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user