show pages, ai, r18, r18g

This commit is contained in:
wgh19
2024-05-16 12:22:33 +08:00
parent ae0be5a97d
commit efd5683529
2 changed files with 84 additions and 1 deletions

View File

@@ -142,6 +142,17 @@ class Tag {
String toString() {
return "$name${translatedName == null ? "" : "($translatedName)"}";
}
@override
bool operator ==(Object other) {
if (other is Tag) {
return name == other.name;
}
return false;
}
@override
int get hashCode => name.hashCode;
}
class IllustImage {
@@ -171,6 +182,10 @@ class Illust {
bool isBookmarked;
final bool isAi;
bool get isR18 => tags.contains(const Tag("R-18", null));
bool get isR18G => tags.contains(const Tag("R-18G", null));
Illust.fromJson(Map<String, dynamic> json)
: id = json['id'],
title = json['title'],
@@ -211,7 +226,7 @@ class Illust {
totalView = json['total_view'],
totalBookmarks = json['total_bookmarks'],
isBookmarked = json['is_bookmarked'],
isAi = json['is_ai'] != 1;
isAi = json['illust_ai_type'] == 2;
}
class TrendingTag {