block tags

This commit is contained in:
wgh19
2024-05-22 09:30:31 +08:00
parent 1a224114fc
commit 471b319891
9 changed files with 59 additions and 21 deletions

22
lib/utils/block.dart Normal file
View File

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