mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
block tags
This commit is contained in:
22
lib/utils/block.dart
Normal file
22
lib/utils/block.dart
Normal 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;
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user