block tags and authors

This commit is contained in:
wgh19
2024-05-22 20:40:35 +08:00
parent de26cba0fa
commit 7641cc8f5c
8 changed files with 500 additions and 118 deletions

View File

@@ -1,7 +1,7 @@
import 'package:pixes/appdata.dart';
import 'package:pixes/network/models.dart';
void checkIllusts(List<Illust> illusts) {
List<Illust> checkIllusts(List<Illust> illusts) {
illusts.removeWhere((illust) {
if (illust.isBlocked) {
return true;
@@ -9,7 +9,7 @@ void checkIllusts(List<Illust> illusts) {
if (appdata.settings["blockTags"] == null) {
return false;
}
if (appdata.settings["blockTags"].contains(illust.author.name)) {
if (appdata.settings["blockTags"].contains("user:${illust.author.name}")) {
return true;
}
for (var tag in illust.tags) {
@@ -19,4 +19,5 @@ void checkIllusts(List<Illust> illusts) {
}
return false;
});
return illusts;
}