v1.4.6+67
All checks were successful
Flutter Schmutter / build (push) Successful in 3m46s

This commit is contained in:
2025-06-23 02:51:49 +02:00
parent e30635304b
commit 405d388db0
4 changed files with 104 additions and 58 deletions

View File

@ -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'],
);
}