This commit is contained in:
@ -7,6 +7,9 @@ class MediaItem {
|
||||
final int mode;
|
||||
final List<Tag>? tags;
|
||||
final List<Favorite>? favorites;
|
||||
final String? username;
|
||||
final String? userchannel;
|
||||
final String? usernetwork;
|
||||
|
||||
MediaItem({
|
||||
required this.id,
|
||||
@ -17,6 +20,9 @@ class MediaItem {
|
||||
required this.mode,
|
||||
this.tags = const [],
|
||||
this.favorites = const [],
|
||||
this.username,
|
||||
this.userchannel,
|
||||
this.usernetwork,
|
||||
});
|
||||
|
||||
String get thumbnailUrl => 'https://f0ck.me/t/$id.webp';
|
||||
@ -33,6 +39,9 @@ class MediaItem {
|
||||
int? mode,
|
||||
List<Tag>? tags,
|
||||
List<Favorite>? favorites,
|
||||
String? username,
|
||||
String? userchannel,
|
||||
String? usernetwork,
|
||||
}) {
|
||||
return MediaItem(
|
||||
id: id ?? this.id,
|
||||
@ -43,6 +52,9 @@ class MediaItem {
|
||||
mode: mode ?? this.mode,
|
||||
tags: tags ?? this.tags,
|
||||
favorites: favorites ?? this.favorites,
|
||||
username: username ?? this.username,
|
||||
userchannel: userchannel ?? this.userchannel,
|
||||
usernetwork: usernetwork ?? this.usernetwork,
|
||||
);
|
||||
}
|
||||
|
||||
@ -64,6 +76,9 @@ class MediaItem {
|
||||
?.map((e) => Favorite.fromJson(e))
|
||||
.toList() ??
|
||||
[],
|
||||
username: json['username'],
|
||||
userchannel: json['userchannel'],
|
||||
usernetwork: json['usernetwork'],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -97,8 +112,8 @@ class Favorite {
|
||||
|
||||
factory Favorite.fromJson(Map<String, dynamic> json) {
|
||||
return Favorite(
|
||||
userId: json['user_id'],
|
||||
username: json['user'],
|
||||
userId: json['userId'],
|
||||
username: json['username'],
|
||||
avatar: json['avatar'],
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user