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

@@ -1,13 +0,0 @@
class BadgeInfo {
String? bgColor;
String? bgColorNight;
String? text;
BadgeInfo({this.bgColor, this.bgColorNight, this.text});
factory BadgeInfo.fromJson(Map<String, dynamic> json) => BadgeInfo(
bgColor: json['bg_color'] as String?,
bgColorNight: json['bg_color_night'] as String?,
text: json['text'] as String?,
);
}

View File

@@ -3,19 +3,13 @@ import 'package:PiliPlus/models_new/pgc/pgc_index_result/list.dart';
class PgcIndexResult {
int? hasNext;
List<PgcIndexItem>? list;
int? num;
int? size;
int? total;
PgcIndexResult({this.hasNext, this.list, this.num, this.size, this.total});
PgcIndexResult({this.hasNext, this.list});
factory PgcIndexResult.fromJson(Map<String, dynamic> json) => PgcIndexResult(
hasNext: json['has_next'] as int?,
list: (json['list'] as List<dynamic>?)
?.map((e) => PgcIndexItem.fromJson(e as Map<String, dynamic>))
.toList(),
num: json['num'] as int?,
size: json['size'] as int?,
total: json['total'] as int?,
);
}

View File

@@ -1,11 +0,0 @@
class FirstEp {
String? cover;
int? epId;
FirstEp({this.cover, this.epId});
factory FirstEp.fromJson(Map<String, dynamic> json) => FirstEp(
cover: json['cover'] as String?,
epId: json['ep_id'] as int?,
);
}

View File

@@ -1,69 +1,26 @@
import 'package:PiliPlus/models_new/pgc/pgc_index_result/badge_info.dart';
import 'package:PiliPlus/models_new/pgc/pgc_index_result/first_ep.dart';
class PgcIndexItem {
String? badge;
BadgeInfo? badgeInfo;
int? badgeType;
String? cover;
FirstEp? firstEp;
String? indexShow;
int? isFinish;
String? link;
int? mediaId;
String? order;
String? orderType;
String? score;
int? seasonId;
int? seasonStatus;
int? seasonType;
String? subTitle;
String? title;
String? titleIcon;
PgcIndexItem({
this.badge,
this.badgeInfo,
this.badgeType,
this.cover,
this.firstEp,
this.indexShow,
this.isFinish,
this.link,
this.mediaId,
this.order,
this.orderType,
this.score,
this.seasonId,
this.seasonStatus,
this.seasonType,
this.subTitle,
this.title,
this.titleIcon,
});
factory PgcIndexItem.fromJson(Map<String, dynamic> json) => PgcIndexItem(
badge: json['badge'] as String?,
badgeInfo: json['badge_info'] == null
? null
: BadgeInfo.fromJson(json['badge_info'] as Map<String, dynamic>),
badgeType: json['badge_type'] as int?,
cover: json['cover'] as String?,
firstEp: json['first_ep'] == null
? null
: FirstEp.fromJson(json['first_ep'] as Map<String, dynamic>),
indexShow: json['index_show'] as String?,
isFinish: json['is_finish'] as int?,
link: json['link'] as String?,
mediaId: json['media_id'] as int?,
order: json['order'] as String?,
orderType: json['order_type'] as String?,
score: json['score'] as String?,
seasonId: json['season_id'] as int?,
seasonStatus: json['season_status'] as int?,
seasonType: json['season_type'] as int?,
subTitle: json['subTitle'] as String?,
title: json['title'] as String?,
titleIcon: json['title_icon'] as String?,
);
}

View File

@@ -1,13 +0,0 @@
class Activity {
String? headBgUrl;
int? id;
String? title;
Activity({this.headBgUrl, this.id, this.title});
factory Activity.fromJson(Map<String, dynamic> json) => Activity(
headBgUrl: json['head_bg_url'] as String?,
id: json['id'] as int?,
title: json['title'] as String?,
);
}

View File

@@ -1,11 +1,9 @@
class Area {
int? id;
String? name;
Area({this.id, this.name});
Area({this.name});
factory Area.fromJson(Map<String, dynamic> json) => Area(
id: json['id'] as int?,
name: json['name'] as String?,
);
}

View File

@@ -1,13 +0,0 @@
class BadgeInfo {
String? bgColor;
String? bgColorNight;
String? text;
BadgeInfo({this.bgColor, this.bgColorNight, this.text});
factory BadgeInfo.fromJson(Map<String, dynamic> json) => BadgeInfo(
bgColor: json['bg_color'] as String?,
bgColorNight: json['bg_color_night'] as String?,
text: json['text'] as String?,
);
}

View File

@@ -1,15 +0,0 @@
class Danmaku {
String? icon;
String? pureText;
String? text;
int? value;
Danmaku({this.icon, this.pureText, this.text, this.value});
factory Danmaku.fromJson(Map<String, dynamic> json) => Danmaku(
icon: json['icon'] as String?,
pureText: json['pure_text'] as String?,
text: json['text'] as String?,
value: json['value'] as int?,
);
}

View File

@@ -1,11 +0,0 @@
class Ed {
int? end;
int? start;
Ed({this.end, this.start});
factory Ed.fromJson(Map<String, dynamic> json) => Ed(
end: json['end'] as int?,
start: json['start'] as int?,
);
}

View File

@@ -1,78 +1,43 @@
import 'package:PiliPlus/models_new/pgc/pgc_info_model/badge_info.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/rights.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/skip.dart';
import 'package:PiliPlus/models_new/video/video_detail/dimension.dart';
import 'package:PiliPlus/models_new/video/video_detail/episode.dart'
show BaseEpisodeItem;
class EpisodeItem extends BaseEpisodeItem {
BadgeInfo? badgeInfo;
int? badgeType;
Dimension? dimension;
int? duration; // pgc: millisec , pugv: sec
bool? enableVt;
String? from;
bool? isViewHide;
String? link;
String? longTitle;
int? pubTime;
int? pv;
// String? releaseDate;
Rights? rights;
int? sectionType;
String? shareCopy;
String? shareUrl;
String? shortLink;
bool? showDrmLoginDialog;
String? showTitle;
Skip? skip;
int? status;
String? subtitle;
String? vid;
int? play;
EpisodeItem({
super.aid,
super.badge,
this.badgeInfo,
this.badgeType,
super.bvid,
super.cid,
super.cover,
this.dimension,
this.duration,
this.enableVt,
super.epId,
this.from,
super.id,
this.isViewHide,
this.link,
this.longTitle,
this.pubTime,
this.pv,
// this.releaseDate,
this.rights,
this.sectionType,
this.shareCopy,
this.shareUrl,
this.shortLink,
this.showDrmLoginDialog,
this.showTitle,
this.skip,
this.status,
this.subtitle,
super.title,
this.vid,
this.play,
});
factory EpisodeItem.fromJson(Map<String, dynamic> json) => EpisodeItem(
aid: json['aid'] as int?,
badge: json['badge'] as String?,
badgeInfo: json['badge_info'] == null
? null
: BadgeInfo.fromJson(json['badge_info'] as Map<String, dynamic>),
badgeType: json['badge_type'] as int?,
bvid: json['bvid'] as String?,
cid: json['cid'] as int?,
cover: json['cover'] as String?,
@@ -80,32 +45,16 @@ class EpisodeItem extends BaseEpisodeItem {
? null
: Dimension.fromJson(json['dimension'] as Map<String, dynamic>),
duration: json['duration'] as int?,
enableVt: json['enable_vt'] as bool?,
epId: json['ep_id'] as int?,
from: json['from'] as String?,
id: json['id'] as int?,
isViewHide: json['is_view_hide'] as bool?,
link: json['link'] as String?,
longTitle: json['long_title'] as String?,
pubTime: json['pub_time'] ?? json['release_date'],
pv: json['pv'] as int?,
// releaseDate: json['release_date'] as String?,
rights: json['rights'] == null
? null
: Rights.fromJson(json['rights'] as Map<String, dynamic>),
sectionType: json['section_type'] as int?,
shareCopy: json['share_copy'] as String?,
shareUrl: json['share_url'] as String?,
shortLink: json['short_link'] as String?,
showDrmLoginDialog: json['showDrmLoginDialog'] as bool?,
showTitle: json['show_title'] as String?,
skip: json['skip'] == null
? null
: Skip.fromJson(json['skip'] as Map<String, dynamic>),
status: json['status'] as int?,
subtitle: json['subtitle'] as String?,
title: json['title'] as String?,
vid: json['vid'] as String?,
play: json['play'] as int?,
);
}

View File

@@ -1,11 +0,0 @@
class IconFont {
String? name;
String? text;
IconFont({this.name, this.text});
factory IconFont.fromJson(Map<String, dynamic> json) => IconFont(
name: json['name'] as String?,
text: json['text'] as String?,
);
}

View File

@@ -1,15 +1,11 @@
class NewEp {
String? desc;
int? id;
int? isNew;
String? title;
NewEp({this.desc, this.id, this.isNew, this.title});
NewEp({this.desc, this.title});
factory NewEp.fromJson(Map<String, dynamic> json) => NewEp(
desc: json['desc'] as String?,
id: json['id'] as int?,
isNew: json['is_new'] as int?,
title: json['title'] as String?,
);
}

View File

@@ -1,11 +0,0 @@
class Op {
int? end;
int? start;
Op({this.end, this.start});
factory Op.fromJson(Map<String, dynamic> json) => Op(
end: json['end'] as int?,
start: json['start'] as int?,
);
}

View File

@@ -1,26 +1,11 @@
class Publish {
int? isFinish;
int? isStarted;
String? pubTime;
String? pubTimeShow;
int? unknowPubDate;
int? weekday;
Publish({
this.isFinish,
this.isStarted,
this.pubTime,
this.pubTimeShow,
this.unknowPubDate,
this.weekday,
});
factory Publish.fromJson(Map<String, dynamic> json) => Publish(
isFinish: json['is_finish'] as int?,
isStarted: json['is_started'] as int?,
pubTime: json['pub_time'] as String?,
pubTimeShow: json['pub_time_show'] as String?,
unknowPubDate: json['unknow_pub_date'] as int?,
weekday: json['weekday'] as int?,
);
}

View File

@@ -1,11 +1,9 @@
class Rating {
int? count;
double? score;
Rating({this.count, this.score});
Rating({this.score});
factory Rating.fromJson(Map<String, dynamic> json) => Rating(
count: json['count'] as int?,
score: (json['score'] as num?)?.toDouble(),
);
}

View File

@@ -1,57 +1,31 @@
import 'package:PiliPlus/models_new/pgc/pgc_info_model/activity.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/area.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/brief.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/cooperator.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/icon_font.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/new_ep.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/publish.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/rating.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/rights.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/season.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/section.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/series.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/stat.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/up_info.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/user_status.dart';
class PgcInfoModel {
Activity? activity;
String? actors;
String? alias;
List<Area>? areas;
String? bkgCover;
String? cover;
bool? enableVt;
List<EpisodeItem>? episodes;
String? evaluate;
int? hideEpVvVtDm;
IconFont? iconFont;
String? jpTitle;
String? link;
int? mediaId;
int? mode;
NewEp? newEp;
Publish? publish;
Rating? rating;
String? record;
Rights? rights;
int? seasonId;
String? seasonTitle;
List<Season>? seasons;
List<Section>? section;
Series? series;
String? shareCopy;
String? shareSubTitle;
String? shareUrl;
int? showSeasonType;
String? squareCover;
String? staff;
PgcStat? stat;
int? status;
String? subtitle;
String? title;
int? total;
int? type;
UpInfo? upInfo;
UserStatus? userStatus;
@@ -59,42 +33,21 @@ class PgcInfoModel {
Brief? brief;
PgcInfoModel({
this.activity,
this.actors,
this.alias,
this.areas,
this.bkgCover,
this.cover,
this.enableVt,
this.episodes,
this.evaluate,
this.hideEpVvVtDm,
this.iconFont,
this.jpTitle,
this.link,
this.mediaId,
this.mode,
this.newEp,
this.publish,
this.rating,
this.record,
this.rights,
this.seasonId,
this.seasonTitle,
this.seasons,
this.section,
this.series,
this.shareCopy,
this.shareSubTitle,
this.shareUrl,
this.showSeasonType,
this.squareCover,
this.staff,
this.stat,
this.status,
this.subtitle,
this.title,
this.total,
this.type,
this.upInfo,
this.userStatus,
@@ -103,29 +56,16 @@ class PgcInfoModel {
});
factory PgcInfoModel.fromJson(Map<String, dynamic> json) => PgcInfoModel(
activity: json['activity'] == null
? null
: Activity.fromJson(json['activity'] as Map<String, dynamic>),
actors: json['actors'] as String?,
alias: json['alias'] as String?,
areas: (json['areas'] as List<dynamic>?)
?.map((e) => Area.fromJson(e as Map<String, dynamic>))
.toList(),
bkgCover: json['bkg_cover'] as String?,
cover: json['cover'] as String?,
enableVt: json['enable_vt'] as bool?,
episodes: (json['episodes'] as List<dynamic>?)
?.map((e) => EpisodeItem.fromJson(e as Map<String, dynamic>))
.toList(),
evaluate: json['evaluate'] as String?,
hideEpVvVtDm: json['hide_ep_vv_vt_dm'] as int?,
iconFont: json['icon_font'] == null
? null
: IconFont.fromJson(json['icon_font'] as Map<String, dynamic>),
jpTitle: json['jp_title'] as String?,
link: json['link'] as String?,
mediaId: json['media_id'] as int?,
mode: json['mode'] as int?,
newEp: json['new_ep'] == null
? null
: NewEp.fromJson(json['new_ep'] as Map<String, dynamic>),
@@ -135,34 +75,16 @@ class PgcInfoModel {
rating: json['rating'] == null
? null
: Rating.fromJson(json['rating'] as Map<String, dynamic>),
record: json['record'] as String?,
rights: json['rights'] == null
? null
: Rights.fromJson(json['rights'] as Map<String, dynamic>),
seasonId: json['season_id'] as int?,
seasonTitle: json['season_title'] as String?,
seasons: (json['seasons'] as List<dynamic>?)
?.map((e) => Season.fromJson(e as Map<String, dynamic>))
.toList(),
section: (json['section'] as List<dynamic>?)
?.map((e) => Section.fromJson(e as Map<String, dynamic>))
.toList(),
series: json['series'] == null
? null
: Series.fromJson(json['series'] as Map<String, dynamic>),
shareCopy: json['share_copy'] as String?,
shareSubTitle: json['share_sub_title'] as String?,
shareUrl: json['share_url'] as String?,
showSeasonType: json['show_season_type'] as int?,
squareCover: json['square_cover'] as String?,
staff: json['staff'] as String?,
stat: json['stat'] == null
? null
: PgcStat.fromJson(json['stat'] as Map<String, dynamic>),
status: json['status'] as int?,
subtitle: json['subtitle'] as String?,
title: json['title'] as String?,
total: json['total'] as int?,
type: json['type'] as int?,
upInfo: json['up_info'] == null
? null

View File

@@ -1,13 +0,0 @@
class Rights {
int? allowDm;
int? allowDownload;
int? areaLimit;
Rights({this.allowDm, this.allowDownload, this.areaLimit});
factory Rights.fromJson(Map<String, dynamic> json) => Rights(
allowDm: json['allow_dm'] as int?,
allowDownload: json['allow_download'] as int?,
areaLimit: json['area_limit'] as int?,
);
}

View File

@@ -1,63 +0,0 @@
import 'package:PiliPlus/models_new/pgc/pgc_info_model/badge_info.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/icon_font.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/new_ep.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/stat.dart';
class Season {
String? badge;
BadgeInfo? badgeInfo;
int? badgeType;
String? cover;
bool? enableVt;
String? horizontalCover1610;
String? horizontalCover169;
IconFont? iconFont;
int? mediaId;
NewEp? newEp;
int? seasonId;
String? seasonTitle;
int? seasonType;
PgcStat? stat;
Season({
this.badge,
this.badgeInfo,
this.badgeType,
this.cover,
this.enableVt,
this.horizontalCover1610,
this.horizontalCover169,
this.iconFont,
this.mediaId,
this.newEp,
this.seasonId,
this.seasonTitle,
this.seasonType,
this.stat,
});
factory Season.fromJson(Map<String, dynamic> json) => Season(
badge: json['badge'] as String?,
badgeInfo: json['badge_info'] == null
? null
: BadgeInfo.fromJson(json['badge_info'] as Map<String, dynamic>),
badgeType: json['badge_type'] as int?,
cover: json['cover'] as String?,
enableVt: json['enable_vt'] as bool?,
horizontalCover1610: json['horizontal_cover_1610'] as String?,
horizontalCover169: json['horizontal_cover_169'] as String?,
iconFont: json['icon_font'] == null
? null
: IconFont.fromJson(json['icon_font'] as Map<String, dynamic>),
mediaId: json['media_id'] as int?,
newEp: json['new_ep'] == null
? null
: NewEp.fromJson(json['new_ep'] as Map<String, dynamic>),
seasonId: json['season_id'] as int?,
seasonTitle: json['season_title'] as String?,
seasonType: json['season_type'] as int?,
stat: json['stat'] == null
? null
: PgcStat.fromJson(json['stat'] as Map<String, dynamic>),
);
}

View File

@@ -1,36 +1,15 @@
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
class Section {
int? attr;
int? episodeId;
List<dynamic>? episodeIds;
List<EpisodeItem>? episodes;
int? id;
String? title;
int? type;
int? type2;
Section({
this.attr,
this.episodeId,
this.episodeIds,
this.episodes,
this.id,
this.title,
this.type,
this.type2,
});
factory Section.fromJson(Map<String, dynamic> json) => Section(
attr: json['attr'] as int?,
episodeId: json['episode_id'] as int?,
episodeIds: json['episode_ids'] as List<dynamic>?,
episodes: (json['episodes'] as List<dynamic>?)
?.map((e) => EpisodeItem.fromJson(e as Map<String, dynamic>))
.toList(),
id: json['id'] as int?,
title: json['title'] as String?,
type: json['type'] as int?,
type2: json['type2'] as int?,
);
}

View File

@@ -1,13 +0,0 @@
class Series {
int? displayType;
int? seriesId;
String? seriesTitle;
Series({this.displayType, this.seriesId, this.seriesTitle});
factory Series.fromJson(Map<String, dynamic> json) => Series(
displayType: json['display_type'] as int?,
seriesId: json['series_id'] as int?,
seriesTitle: json['series_title'] as String?,
);
}

View File

@@ -1,18 +0,0 @@
import 'package:PiliPlus/models_new/pgc/pgc_info_model/ed.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/op.dart';
class Skip {
Ed? ed;
Op? op;
Skip({this.ed, this.op});
factory Skip.fromJson(Map<String, dynamic> json) => Skip(
ed: json['ed'] == null
? null
: Ed.fromJson(json['ed'] as Map<String, dynamic>),
op: json['op'] == null
? null
: Op.fromJson(json['op'] as Map<String, dynamic>),
);
}

View File

@@ -1,19 +1,13 @@
import 'package:PiliPlus/models_new/video/video_detail/stat_detail.dart';
class PgcStat extends StatDetail {
int? favorites;
String? followText;
PgcStat.fromJson(Map<String, dynamic> json) {
coin = json["coins"] ?? 0;
danmaku = json["danmakus"];
favorite = json["favorite"] ?? 0;
favorites = json["favorites"];
followText = json["follow_text"];
like = json["likes"] ?? 0;
reply = json["reply"];
share = json["share"];
view = json["views"];
vt = json["vt"];
}
}

View File

@@ -1,24 +0,0 @@
import 'package:PiliPlus/models_new/pgc/pgc_info_model/danmaku.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/vt.dart';
class StatForUnity {
num? coin;
Danmaku? danmaku;
int? likes;
int? reply;
Vt? vt;
StatForUnity({this.coin, this.danmaku, this.likes, this.reply, this.vt});
factory StatForUnity.fromJson(Map<String, dynamic> json) => StatForUnity(
coin: json['coin'] as num?,
danmaku: json['danmaku'] == null
? null
: Danmaku.fromJson(json['danmaku'] as Map<String, dynamic>),
likes: json['likes'] as int?,
reply: json['reply'] as int?,
vt: json['vt'] == null
? null
: Vt.fromJson(json['vt'] as Map<String, dynamic>),
);
}

View File

@@ -1,41 +1,17 @@
class UpInfo {
String? avatar;
String? avatarSubscriptUrl;
int? follower;
int? isFollow;
int? mid;
String? nicknameColor;
int? themeType;
String? uname;
int? verifyType;
int? vipStatus;
int? vipType;
UpInfo({
this.avatar,
this.avatarSubscriptUrl,
this.follower,
this.isFollow,
this.mid,
this.nicknameColor,
this.themeType,
this.uname,
this.verifyType,
this.vipStatus,
this.vipType,
});
factory UpInfo.fromJson(Map<String, dynamic> json) => UpInfo(
avatar: json['avatar'] as String?,
avatarSubscriptUrl: json['avatar_subscript_url'] as String?,
follower: json['follower'] as int?,
isFollow: json['is_follow'] as int?,
mid: json['mid'] as int?,
nicknameColor: json['nickname_color'] as String?,
themeType: json['theme_type'] as int?,
uname: json['uname'] as String?,
verifyType: json['verify_type'] as int?,
vipStatus: json['vip_status'] as int?,
vipType: json['vip_type'] as int?,
);
}

View File

@@ -1,15 +1,11 @@
class UserProgress {
UserProgress({
this.lastEpId,
this.lastEpIndex,
this.lastTime,
});
int? lastEpId;
String? lastEpIndex;
int? lastTime;
UserProgress.fromJson(Map<String, dynamic> json) {
lastEpId = json['last_ep_id'];
lastEpIndex = json['last_ep_index'];
lastTime = json['last_time'];
}
}

View File

@@ -1,39 +1,15 @@
import 'package:PiliPlus/models_new/pgc/pgc_info_model/user_progress.dart';
class UserStatus {
int? areaLimit;
int? banAreaShow;
int? follow;
int? followStatus;
int? login;
int? pay;
int? payPackPaid;
int? sponsor;
UserProgress? progress;
int? favored;
UserStatus({
this.areaLimit,
this.banAreaShow,
this.follow,
this.followStatus,
this.login,
this.pay,
this.payPackPaid,
this.sponsor,
this.progress,
this.favored,
});
factory UserStatus.fromJson(Map<String, dynamic> json) => UserStatus(
areaLimit: json['area_limit'] as int?,
banAreaShow: json['ban_area_show'] as int?,
follow: json['follow'] as int?,
followStatus: json['follow_status'] as int?,
login: json['login'] as int?,
pay: json['pay'] as int?,
payPackPaid: json['pay_pack_paid'] as int?,
sponsor: json['sponsor'] as int?,
progress: json['progress'] == null
? null
: UserProgress.fromJson(json['progress']),

View File

@@ -1,15 +0,0 @@
class Vt {
String? icon;
String? pureText;
String? text;
int? value;
Vt({this.icon, this.pureText, this.text, this.value});
factory Vt.fromJson(Map<String, dynamic> json) => Vt(
icon: json['icon'] as String?,
pureText: json['pure_text'] as String?,
text: json['text'] as String?,
value: json['value'] as int?,
);
}

View File

@@ -1,13 +0,0 @@
class BadgeInfo {
String? bgColor;
String? bgColorNight;
String? text;
BadgeInfo({this.bgColor, this.bgColorNight, this.text});
factory BadgeInfo.fromJson(Map<String, dynamic> json) => BadgeInfo(
bgColor: json['bg_color'] as String?,
bgColorNight: json['bg_color_night'] as String?,
text: json['text'] as String?,
);
}

View File

@@ -1,11 +0,0 @@
class IconFont {
String? name;
String? text;
IconFont({this.name, this.text});
factory IconFont.fromJson(Map<String, dynamic> json) => IconFont(
name: json['name'] as String?,
text: json['text'] as String?,
);
}

View File

@@ -1,11 +1,9 @@
class NewEp {
String? cover;
String? indexShow;
NewEp({this.cover, this.indexShow});
NewEp({this.indexShow});
factory NewEp.fromJson(Map<String, dynamic> json) => NewEp(
cover: json['cover'] as String?,
indexShow: json['index_show'] as String?,
);
}

View File

@@ -1,38 +1,16 @@
import 'package:PiliPlus/models_new/pgc/pgc_rank/badge_info.dart';
import 'package:PiliPlus/models_new/pgc/pgc_rank/icon_font.dart';
import 'package:PiliPlus/models_new/pgc/pgc_rank/new_ep.dart';
import 'package:PiliPlus/models_new/pgc/pgc_rank/stat.dart';
class PgcRankItemModel {
String? badge;
BadgeInfo? badgeInfo;
int? badgeType;
String? cover;
String? desc;
bool? enableVt;
IconFont? iconFont;
NewEp? newEp;
int? rank;
String? rating;
int? seasonId;
String? ssHorizontalCover;
Stat? stat;
String? title;
String? url;
PgcRankItemModel({
this.badge,
this.badgeInfo,
this.badgeType,
this.cover,
this.desc,
this.enableVt,
this.iconFont,
this.newEp,
this.rank,
this.rating,
this.seasonId,
this.ssHorizontalCover,
this.stat,
this.title,
this.url,
@@ -40,24 +18,10 @@ class PgcRankItemModel {
factory PgcRankItemModel.fromJson(Map<String, dynamic> json) =>
PgcRankItemModel(
badge: json['badge'] as String?,
badgeInfo: json['badge_info'] == null
? null
: BadgeInfo.fromJson(json['badge_info'] as Map<String, dynamic>),
badgeType: json['badge_type'] as int?,
cover: json['cover'] as String?,
desc: json['desc'] as String?,
enableVt: json['enable_vt'] as bool?,
iconFont: json['icon_font'] == null
? null
: IconFont.fromJson(json['icon_font'] as Map<String, dynamic>),
newEp: json['new_ep'] == null
? null
: NewEp.fromJson(json['new_ep'] as Map<String, dynamic>),
rank: json['rank'] as int?,
rating: json['rating'] as String?,
seasonId: json['season_id'] as int?,
ssHorizontalCover: json['ss_horizontal_cover'] as String?,
stat: json['stat'] == null
? null
: Stat.fromJson(json['stat'] as Map<String, dynamic>),

View File

@@ -1,15 +1,11 @@
class Stat {
int? danmaku;
int? follow;
int? seriesFollow;
int? view;
Stat({this.danmaku, this.follow, this.seriesFollow, this.view});
Stat({this.follow, this.view});
factory Stat.fromJson(Map<String, dynamic> json) => Stat(
danmaku: json['danmaku'] as int?,
follow: (json['follow'] as int?) ?? 0,
seriesFollow: json['series_follow'] as int?,
view: (json['view'] as int?) ?? 0,
);
}

View File

@@ -5,11 +5,6 @@ class PgcReviewItemModel {
Author? author;
String? title;
String? content;
int? ctime;
int? mediaId;
int? mid;
int? mtime;
String? progress;
String? pushTimeStr;
int? reviewId;
late int score;
@@ -20,11 +15,6 @@ class PgcReviewItemModel {
this.author,
this.title,
this.content,
this.ctime,
this.mediaId,
this.mid,
this.mtime,
this.progress,
this.pushTimeStr,
this.reviewId,
required this.score,
@@ -40,11 +30,6 @@ class PgcReviewItemModel {
: Author.fromJson(json['author'] as Map<String, dynamic>),
title: json['title'] as String?,
content: json['content'] as String?,
ctime: json['ctime'] as int?,
mediaId: json['media_id'] as int?,
mid: json['mid'] as int?,
mtime: json['mtime'] as int?,
progress: json['progress'] as String?,
pushTimeStr: json['push_time_str'] as String?,
reviewId: json['review_id'] as int?,
score: json['score'] == null ? 0 : json['score'] ~/ 2,

View File

@@ -1,69 +1,29 @@
import 'package:PiliPlus/models_new/pgc/pgc_timeline/icon_font.dart';
class Episode {
String? cover;
int? delay;
int? delayId;
String? delayIndex;
String? delayReason;
bool? enableVt;
String? epCover;
int? episodeId;
int? follow;
String? follows;
IconFont? iconFont;
String? plays;
String? pubIndex;
String? pubTime;
int? pubTs;
int? published;
int? seasonId;
String? squareCover;
String? title;
Episode({
this.cover,
this.delay,
this.delayId,
this.delayIndex,
this.delayReason,
this.enableVt,
this.epCover,
this.episodeId,
this.follow,
this.follows,
this.iconFont,
this.plays,
this.pubIndex,
this.pubTime,
this.pubTs,
this.published,
this.seasonId,
this.squareCover,
this.title,
});
factory Episode.fromJson(Map<String, dynamic> json) => Episode(
cover: json['cover'] as String?,
delay: json['delay'] as int?,
delayId: json['delay_id'] as int?,
delayIndex: json['delay_index'] as String?,
delayReason: json['delay_reason'] as String?,
enableVt: json['enable_vt'] as bool?,
epCover: json['ep_cover'] as String?,
episodeId: json['episode_id'] as int?,
follow: json['follow'] as int?,
follows: json['follows'] as String?,
iconFont: json['icon_font'] == null
? null
: IconFont.fromJson(json['icon_font'] as Map<String, dynamic>),
plays: json['plays'] as String?,
pubIndex: json['pub_index'] as String?,
pubTime: json['pub_time'] as String?,
pubTs: json['pub_ts'] as int?,
published: json['published'] as int?,
seasonId: json['season_id'] as int?,
squareCover: json['square_cover'] as String?,
title: json['title'] as String?,
);
}

View File

@@ -1,11 +0,0 @@
class IconFont {
String? name;
String? text;
IconFont({this.name, this.text});
factory IconFont.fromJson(Map<String, dynamic> json) => IconFont(
name: json['name'] as String?,
text: json['text'] as String?,
);
}

View File

@@ -1,15 +1,11 @@
import 'package:PiliPlus/models_new/pgc/pgc_timeline/result.dart';
class PgcTimeline {
int? code;
String? message;
List<TimelineResult>? result;
PgcTimeline({this.code, this.message, this.result});
PgcTimeline({this.result});
factory PgcTimeline.fromJson(Map<String, dynamic> json) => PgcTimeline(
code: json['code'] as int?,
message: json['message'] as String?,
result: (json['result'] as List<dynamic>?)
?.map((e) => TimelineResult.fromJson(e as Map<String, dynamic>))
.toList(),