feat: release v2.0.6 with full Pawchive API integration (global feed, tags, links, announcements, server media filter)

This commit is contained in:
2026-09-03 20:43:38 +03:00
parent 84eeb909a1
commit b82d87161e
14 changed files with 652 additions and 67 deletions
@@ -0,0 +1,35 @@
class ArtistAnnouncement {
const ArtistAnnouncement({
required this.service,
required this.userId,
required this.content,
this.hash,
this.added,
});
final String service;
final String userId;
final String content;
final String? hash;
final DateTime? added;
factory ArtistAnnouncement.fromJson(Map<String, dynamic> json) {
return ArtistAnnouncement(
service: (json['service'] ?? '').toString(),
userId: (json['user_id'] ?? '').toString(),
content: (json['content'] ?? '').toString(),
hash: json['hash']?.toString(),
added: json['added'] != null
? DateTime.tryParse(json['added'].toString())
: null,
);
}
Map<String, dynamic> toJson() => {
'service': service,
'user_id': userId,
'content': content,
if (hash != null) 'hash': hash,
if (added != null) 'added': added?.toIso8601String(),
};
}
+39
View File
@@ -0,0 +1,39 @@
class ArtistLink {
const ArtistLink({
required this.id,
required this.service,
required this.name,
this.publicId,
this.indexed,
this.updated,
});
final String id;
final String service;
final String name;
final String? publicId;
final DateTime? indexed;
final DateTime? updated;
factory ArtistLink.fromJson(Map<String, dynamic> json) {
return ArtistLink(
id: (json['id'] ?? '').toString(),
service: (json['service'] ?? '').toString(),
name: (json['name'] ?? '').toString(),
publicId: json['public_id']?.toString(),
indexed: json['indexed'] != null
? DateTime.tryParse(json['indexed'].toString())
: null,
updated: json['updated'] != null
? DateTime.tryParse(json['updated'].toString())
: null,
);
}
Map<String, dynamic> toJson() => {
'id': id,
'service': service,
'name': name,
if (publicId != null) 'public_id': publicId,
};
}
+21
View File
@@ -0,0 +1,21 @@
class ArtistTag {
const ArtistTag({
required this.tag,
required this.postCount,
});
final String tag;
final int postCount;
factory ArtistTag.fromJson(Map<String, dynamic> json) {
return ArtistTag(
tag: (json['tag'] ?? '').toString(),
postCount: (json['post_count'] as num?)?.toInt() ?? 0,
);
}
Map<String, dynamic> toJson() => {
'tag': tag,
'post_count': postCount,
};
}
+33 -2
View File
@@ -4,12 +4,34 @@ class ArtistWorkQuery {
required this.service,
required this.artistId,
required this.artistName,
this.queryText,
this.tagFilter,
});
final String providerId;
final String service;
final String artistId;
final String artistName;
final String? queryText;
final String? tagFilter;
ArtistWorkQuery copyWith({
String? providerId,
String? service,
String? artistId,
String? artistName,
String? queryText,
String? tagFilter,
}) {
return ArtistWorkQuery(
providerId: providerId ?? this.providerId,
service: service ?? this.service,
artistId: artistId ?? this.artistId,
artistName: artistName ?? this.artistName,
queryText: queryText ?? this.queryText,
tagFilter: tagFilter ?? this.tagFilter,
);
}
@override
bool operator ==(Object other) {
@@ -17,9 +39,18 @@ class ArtistWorkQuery {
other.providerId == providerId &&
other.service == service &&
other.artistId == artistId &&
other.artistName == artistName;
other.artistName == artistName &&
other.queryText == queryText &&
other.tagFilter == tagFilter;
}
@override
int get hashCode => Object.hash(providerId, service, artistId, artistName);
int get hashCode => Object.hash(
providerId,
service,
artistId,
artistName,
queryText,
tagFilter,
);
}