clean up models

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-05 12:10:18 +08:00
parent b897103af0
commit 279f21857d
308 changed files with 156 additions and 6243 deletions

View File

@@ -4,9 +4,8 @@ class SpaceFavData {
int? id;
String? name;
MediaListResponse? mediaListResponse;
String? uri;
SpaceFavData({this.id, this.name, this.mediaListResponse, this.uri});
SpaceFavData({this.id, this.name, this.mediaListResponse});
factory SpaceFavData.fromJson(Map<String, dynamic> json) => SpaceFavData(
id: json['id'] as int?,
@@ -16,6 +15,5 @@ class SpaceFavData {
: MediaListResponse.fromJson(
json['mediaListResponse'] as Map<String, dynamic>,
),
uri: json['uri'] as String?,
);
}

View File

@@ -14,7 +14,6 @@ class SpaceFavItemModel extends SubItemModel {
super.fid,
super.mid,
super.attr,
super.attrDesc,
super.title,
super.cover,
super.upper,
@@ -26,13 +25,7 @@ class SpaceFavItemModel extends SubItemModel {
super.favState,
super.mediaCount,
super.viewCount,
super.vt,
super.isTop,
super.recentFav,
super.playSwitch,
super.type,
super.link,
super.bvid,
});
factory SpaceFavItemModel.fromJson(Map<String, dynamic> json) =>
@@ -44,7 +37,6 @@ class SpaceFavItemModel extends SubItemModel {
fid: json['fid'] as int?,
mid: json['mid'] as int?,
attr: json['attr'] as int?,
attrDesc: json['attr_desc'] as String?,
title: json['title'] as String?,
cover: json['cover'] as String?,
upper: json['upper'] == null
@@ -58,12 +50,6 @@ class SpaceFavItemModel extends SubItemModel {
favState: json['fav_state'] as int?,
mediaCount: json['media_count'] as int?,
viewCount: json['view_count'] as int?,
vt: json['vt'] as int?,
isTop: json['is_top'] as bool?,
recentFav: json['recent_fav'] as dynamic,
playSwitch: json['play_switch'] as int?,
type: json['type'] as int?,
link: json['link'] as String?,
bvid: json['bvid'] as String?,
);
}

View File

@@ -3,9 +3,8 @@ import 'package:PiliPlus/models_new/space/space_fav/list.dart';
class MediaListResponse {
int? count;
List<SpaceFavItemModel>? list;
bool? hasMore;
MediaListResponse({this.count, this.list, this.hasMore});
MediaListResponse({this.count, this.list});
factory MediaListResponse.fromJson(Map<String, dynamic> json) {
return MediaListResponse(
@@ -13,7 +12,6 @@ class MediaListResponse {
list: (json['list'] as List<dynamic>?)
?.map((e) => SpaceFavItemModel.fromJson(e as Map<String, dynamic>))
.toList(),
hasMore: json['has_more'] as bool?,
);
}
}