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,93 +1,42 @@
import 'package:PiliPlus/models/model_owner.dart';
import 'package:PiliPlus/models_new/video/video_detail/dimension.dart';
import 'package:PiliPlus/models_new/video/video_detail/rights.dart';
import 'package:PiliPlus/models_new/video/video_detail/stat.dart';
class Arc {
int? aid;
int? videos;
int? typeId;
String? typeName;
int? copyright;
String? pic;
String? title;
int? pubdate;
int? ctime;
String? desc;
int? state;
int? duration;
Rights? rights;
Owner? author;
VideoStat? stat;
String? dynam1c;
Dimension? dimension;
bool? isChargeableSeason;
bool? isBlooper;
int? enableVt;
String? vtDisplay;
int? typeIdV2;
String? typeNameV2;
int? isLessonVideo;
Arc({
this.aid,
this.videos,
this.typeId,
this.typeName,
this.copyright,
this.pic,
this.title,
this.pubdate,
this.ctime,
this.desc,
this.state,
this.duration,
this.rights,
this.author,
this.stat,
this.dynam1c,
this.dimension,
this.isChargeableSeason,
this.isBlooper,
this.enableVt,
this.vtDisplay,
this.typeIdV2,
this.typeNameV2,
this.isLessonVideo,
});
factory Arc.fromJson(Map<String, dynamic> json) => Arc(
aid: json['aid'] as int?,
videos: json['videos'] as int?,
typeId: json['type_id'] as int?,
typeName: json['type_name'] as String?,
copyright: json['copyright'] as int?,
pic: json['pic'] as String?,
title: json['title'] as String?,
pubdate: json['pubdate'] as int?,
ctime: json['ctime'] as int?,
desc: json['desc'] as String?,
state: json['state'] as int?,
duration: json['duration'] as int?,
rights: json['rights'] == null
? null
: Rights.fromJson(json['rights'] as Map<String, dynamic>),
author: json['author'] == null
? null
: Owner.fromJson(json['author'] as Map<String, dynamic>),
stat: json['stat'] == null
? null
: VideoStat.fromJson(json['stat'] as Map<String, dynamic>),
dynam1c: json['dynamic'] as String?,
dimension: json['dimension'] == null
? null
: Dimension.fromJson(json['dimension'] as Map<String, dynamic>),
isChargeableSeason: json['is_chargeable_season'] as bool?,
isBlooper: json['is_blooper'] as bool?,
enableVt: json['enable_vt'] as int?,
vtDisplay: json['vt_display'] as String?,
typeIdV2: json['type_id_v2'] as int?,
typeNameV2: json['type_name_v2'] as String?,
isLessonVideo: json['is_lesson_video'] as int?,
);
}

View File

@@ -1,13 +1,9 @@
class ArgueInfo {
String? argueMsg;
int? argueType;
String? argueLink;
ArgueInfo({this.argueMsg, this.argueType, this.argueLink});
ArgueInfo({this.argueMsg});
factory ArgueInfo.fromJson(Map<String, dynamic> json) => ArgueInfo(
argueMsg: json['argue_msg'] as String?,
argueType: json['argue_type'] as int?,
argueLink: json['argue_link'] as String?,
);
}

View File

@@ -6,19 +6,13 @@ import 'package:PiliPlus/models_new/video/video_detail/page.dart';
import 'package:PiliPlus/models_new/video/video_detail/rights.dart';
import 'package:PiliPlus/models_new/video/video_detail/staff.dart';
import 'package:PiliPlus/models_new/video/video_detail/stat.dart';
import 'package:PiliPlus/models_new/video/video_detail/subtitle.dart';
import 'package:PiliPlus/models_new/video/video_detail/ugc_season.dart';
import 'package:PiliPlus/models_new/video/video_detail/user_garb.dart';
import 'package:PiliPlus/utils/parse_string.dart';
class VideoDetailData {
String? bvid;
int? aid;
int? videos;
int? tid;
int? tidV2;
String? tname;
String? tnameV2;
int? copyright;
String? pic;
String? title;
@@ -26,36 +20,17 @@ class VideoDetailData {
int? ctime;
String? desc;
List<DescV2>? descV2;
int? state;
int? duration;
Rights? rights;
Owner? owner;
VideoStat? stat;
ArgueInfo? argueInfo;
String? dynam1c;
int? cid;
Dimension? dimension;
int? seasonId;
int? teenageMode;
bool? isChargeableSeason;
bool? isStory;
bool? isUpowerExclusive;
bool? isUpowerPlay;
bool? isUpowerPreview;
int? enableVt;
String? vtDisplay;
bool? isUpowerExclusiveWithQa;
bool? noCache;
List<Part>? pages;
Subtitle? subtitle;
UgcSeason? ugcSeason;
bool? isSeasonDisplay;
UserGarb? userGarb;
String? likeIcon;
bool? needJumpBv;
bool? disableShowUpInfo;
int? isStoryPlay;
bool? isViewSelf;
List<Staff>? staff;
String? redirectUrl;
bool isPageReversed = false;
@@ -64,10 +39,6 @@ class VideoDetailData {
this.bvid,
this.aid,
this.videos,
this.tid,
this.tidV2,
this.tname,
this.tnameV2,
this.copyright,
this.pic,
this.title,
@@ -75,36 +46,17 @@ class VideoDetailData {
this.ctime,
this.desc,
this.descV2,
this.state,
this.duration,
this.rights,
this.owner,
this.stat,
this.argueInfo,
this.dynam1c,
this.cid,
this.dimension,
this.seasonId,
this.teenageMode,
this.isChargeableSeason,
this.isStory,
this.isUpowerExclusive,
this.isUpowerPlay,
this.isUpowerPreview,
this.enableVt,
this.vtDisplay,
this.isUpowerExclusiveWithQa,
this.noCache,
this.pages,
this.subtitle,
this.ugcSeason,
this.isSeasonDisplay,
this.userGarb,
this.likeIcon,
this.needJumpBv,
this.disableShowUpInfo,
this.isStoryPlay,
this.isViewSelf,
this.staff,
this.redirectUrl,
});
@@ -114,10 +66,6 @@ class VideoDetailData {
bvid: json['bvid'] as String?,
aid: json['aid'] as int?,
videos: json['videos'] as int?,
tid: json['tid'] as int?,
tidV2: json['tid_v2'] as int?,
tname: json['tname'] as String?,
tnameV2: json['tname_v2'] as String?,
copyright: json['copyright'] as int?,
pic: json['pic'] as String?,
title: json['title'] as String?,
@@ -127,7 +75,6 @@ class VideoDetailData {
descV2: (json['desc_v2'] as List<dynamic>?)
?.map((e) => DescV2.fromJson(e as Map<String, dynamic>))
.toList(),
state: json['state'] as int?,
duration: json['duration'] as int?,
rights: json['rights'] == null
? null
@@ -141,40 +88,18 @@ class VideoDetailData {
argueInfo: json['argue_info'] == null
? null
: ArgueInfo.fromJson(json['argue_info'] as Map<String, dynamic>),
dynam1c: json['dynamic'] as String?,
cid: json['cid'] as int?,
dimension: json['dimension'] == null
? null
: Dimension.fromJson(json['dimension'] as Map<String, dynamic>),
seasonId: json['season_id'] as int?,
teenageMode: json['teenage_mode'] as int?,
isChargeableSeason: json['is_chargeable_season'] as bool?,
isStory: json['is_story'] as bool?,
isUpowerExclusive: json['is_upower_exclusive'] as bool?,
isUpowerPlay: json['is_upower_play'] as bool?,
isUpowerPreview: json['is_upower_preview'] as bool?,
enableVt: json['enable_vt'] as int?,
vtDisplay: json['vt_display'] as String?,
isUpowerExclusiveWithQa: json['is_upower_exclusive_with_qa'] as bool?,
noCache: json['no_cache'] as bool?,
pages: (json['pages'] as List<dynamic>?)
?.map((e) => Part.fromJson(e as Map<String, dynamic>))
.toList(),
subtitle: json['subtitle'] == null
? null
: Subtitle.fromJson(json['subtitle'] as Map<String, dynamic>),
ugcSeason: json['ugc_season'] == null
? null
: UgcSeason.fromJson(json['ugc_season'] as Map<String, dynamic>),
isSeasonDisplay: json['is_season_display'] as bool?,
userGarb: json['user_garb'] == null
? null
: UserGarb.fromJson(json['user_garb'] as Map<String, dynamic>),
likeIcon: json['like_icon'] as String?,
needJumpBv: json['need_jump_bv'] as bool?,
disableShowUpInfo: json['disable_show_up_info'] as bool?,
isStoryPlay: json['is_story_play'] as int?,
isViewSelf: json['is_view_self'] as bool?,
staff: (json["staff"] as List?)
?.map((item) => Staff.fromJson(item))
.toList(),

View File

@@ -1,62 +1,11 @@
class Rights {
int? bp;
int? elec;
int? download;
int? movie;
int? pay;
int? hd5;
int? noReprint;
int? autoplay;
int? ugcPay;
int? isCooperation;
int? ugcPayPreview;
int? noBackground;
int? cleanMode;
int? isSteinGate;
int? is360;
int? noShare;
int? arcPay;
int? freeWatch;
Rights({
this.bp,
this.elec,
this.download,
this.movie,
this.pay,
this.hd5,
this.noReprint,
this.autoplay,
this.ugcPay,
this.isCooperation,
this.ugcPayPreview,
this.noBackground,
this.cleanMode,
this.isSteinGate,
this.is360,
this.noShare,
this.arcPay,
this.freeWatch,
});
factory Rights.fromJson(Map<String, dynamic> json) => Rights(
bp: json['bp'] as int?,
elec: json['elec'] as int?,
download: json['download'] as int?,
movie: json['movie'] as int?,
pay: json['pay'] as int?,
hd5: json['hd5'] as int?,
noReprint: json['no_reprint'] as int?,
autoplay: json['autoplay'] as int?,
ugcPay: json['ugc_pay'] as int?,
isCooperation: json['is_cooperation'] as int?,
ugcPayPreview: json['ugc_pay_preview'] as int?,
noBackground: json['no_background'] as int?,
cleanMode: json['clean_mode'] as int?,
isSteinGate: json['is_stein_gate'] as int?,
is360: json['is_360'] as int?,
noShare: json['no_share'] as int?,
arcPay: json['arc_pay'] as int?,
freeWatch: json['free_watch'] as int?,
);
}

View File

@@ -1,25 +1,13 @@
import 'package:PiliPlus/models_new/video/video_detail/stat_detail.dart';
class VideoStat extends StatDetail {
int? aid;
int? nowRank;
int? hisRank;
int? dislike;
String? evaluation;
VideoStat.fromJson(Map<String, dynamic> json) {
aid = json['aid'] as int?;
view = json['view'] as int?;
danmaku = json['danmaku'] as int?;
reply = json['reply'] as int?;
favorite = json['favorite'] as int? ?? 0;
coin = json['coin'] as num? ?? 0;
share = json['share'] as int?;
nowRank = json['now_rank'] as int?;
hisRank = json['his_rank'] as int?;
like = json['like'] as int? ?? 0;
dislike = json['dislike'] as int?;
evaluation = json['evaluation'] as String?;
vt = json['vt'] as int?;
}
}

View File

@@ -6,5 +6,4 @@ abstract class StatDetail {
int? reply;
int? share;
int? view;
int? vt;
}

View File

@@ -1,11 +0,0 @@
class Subtitle {
bool? allowSubmit;
List<dynamic>? list;
Subtitle({this.allowSubmit, this.list});
factory Subtitle.fromJson(Map<String, dynamic> json) => Subtitle(
allowSubmit: json['allow_submit'] as bool?,
list: json['list'] as List<dynamic>?,
);
}

View File

@@ -1,35 +1,18 @@
import 'package:PiliPlus/models_new/video/video_detail/section.dart';
import 'package:PiliPlus/models_new/video/video_detail/stat.dart';
class UgcSeason {
int? id;
String? title;
String? cover;
int? mid;
String? intro;
int? signState;
int? attribute;
List<SectionItem>? sections;
VideoStat? stat;
int? epCount;
int? seasonType;
bool? isPaySeason;
int? enableVt;
UgcSeason({
this.id,
this.title,
this.cover,
this.mid,
this.intro,
this.signState,
this.attribute,
this.sections,
this.stat,
this.epCount,
this.seasonType,
this.isPaySeason,
this.enableVt,
});
factory UgcSeason.fromJson(Map<String, dynamic> json) => UgcSeason(
@@ -37,18 +20,8 @@ class UgcSeason {
title: json['title'] as String?,
cover: json['cover'] as String?,
mid: json['mid'] as int?,
intro: json['intro'] as String?,
signState: json['sign_state'] as int?,
attribute: json['attribute'] as int?,
sections: (json['sections'] as List<dynamic>?)
?.map((e) => SectionItem.fromJson(e as Map<String, dynamic>))
.toList(),
stat: json['stat'] == null
? null
: VideoStat.fromJson(json['stat'] as Map<String, dynamic>),
epCount: json['ep_count'] as int?,
seasonType: json['season_type'] as int?,
isPaySeason: json['is_pay_season'] as bool?,
enableVt: json['enable_vt'] as int?,
);
}

View File

@@ -1,9 +0,0 @@
class UserGarb {
String? urlImageAniCut;
UserGarb({this.urlImageAniCut});
factory UserGarb.fromJson(Map<String, dynamic> json) => UserGarb(
urlImageAniCut: json['url_image_ani_cut'] as String?,
);
}