mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 11:06:51 +08:00
refa: video model (#523)
This commit is contained in:
committed by
GitHub
parent
bf464994df
commit
7a6085e923
@@ -1,3 +1,7 @@
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
|
||||
import '../model_video.dart';
|
||||
|
||||
class MemberArchiveDataModel {
|
||||
MemberArchiveDataModel({
|
||||
this.list,
|
||||
@@ -51,114 +55,60 @@ class TListItemModel {
|
||||
}
|
||||
}
|
||||
|
||||
class VListItemModel {
|
||||
VListItemModel({
|
||||
this.comment,
|
||||
this.typeid,
|
||||
this.play,
|
||||
this.pic,
|
||||
this.subtitle,
|
||||
this.description,
|
||||
this.copyright,
|
||||
this.title,
|
||||
this.review,
|
||||
this.author,
|
||||
this.mid,
|
||||
this.created,
|
||||
this.pubdate,
|
||||
this.length,
|
||||
this.duration,
|
||||
this.videoReview,
|
||||
this.aid,
|
||||
this.bvid,
|
||||
this.cid,
|
||||
this.hideClick,
|
||||
this.isChargingSrc,
|
||||
this.rcmdReason,
|
||||
this.owner,
|
||||
});
|
||||
|
||||
class VListItemModel extends BaseVideoItemModel {
|
||||
int? comment;
|
||||
int? typeid;
|
||||
int? play;
|
||||
String? pic;
|
||||
String? subtitle;
|
||||
String? description;
|
||||
String? copyright;
|
||||
String? title;
|
||||
int? review;
|
||||
String? author;
|
||||
int? mid;
|
||||
int? created;
|
||||
int? pubdate;
|
||||
String? length;
|
||||
String? duration;
|
||||
int? videoReview;
|
||||
int? aid;
|
||||
String? bvid;
|
||||
int? cid;
|
||||
bool? hideClick;
|
||||
bool? isChargingSrc;
|
||||
Stat? stat;
|
||||
String? rcmdReason;
|
||||
Owner? owner;
|
||||
|
||||
VListItemModel.fromJson(Map<String, dynamic> json) {
|
||||
comment = json['comment'];
|
||||
typeid = json['typeid'];
|
||||
play = json['play'];
|
||||
pic = json['pic'];
|
||||
subtitle = json['subtitle'];
|
||||
description = json['description'];
|
||||
desc = json['description'];
|
||||
copyright = json['copyright'];
|
||||
title = json['title'];
|
||||
review = json['review'];
|
||||
author = json['author'];
|
||||
mid = json['mid'];
|
||||
created = json['created'];
|
||||
pubdate = json['created'];
|
||||
length = json['length'];
|
||||
duration = json['length'];
|
||||
videoReview = json['video_review'];
|
||||
if (json['length'] != null) duration = Utils.duration(json['length']);
|
||||
aid = json['aid'];
|
||||
bvid = json['bvid'];
|
||||
cid = null;
|
||||
hideClick = json['hide_click'];
|
||||
isChargingSrc = json['is_charging_arc'];
|
||||
stat = Stat.fromJson(json);
|
||||
rcmdReason = null;
|
||||
owner = Owner.fromJson(json);
|
||||
stat = VListStat.fromJson(json);
|
||||
owner = VListOwner.fromJson(json);
|
||||
}
|
||||
|
||||
// @override
|
||||
// int? cid = null;
|
||||
|
||||
// @override
|
||||
// String? rcmdReason = null;
|
||||
|
||||
// @override
|
||||
// String? goto;
|
||||
|
||||
// @override
|
||||
// bool isFollowed;
|
||||
|
||||
// @override
|
||||
// String? uri;
|
||||
}
|
||||
|
||||
class VListOwner extends BaseOwner {
|
||||
VListOwner.fromJson(Map<String, dynamic> json) {
|
||||
mid = json["mid"];
|
||||
name = json["author"];
|
||||
}
|
||||
}
|
||||
|
||||
class Stat {
|
||||
Stat({
|
||||
this.view,
|
||||
this.danmu,
|
||||
});
|
||||
|
||||
int? view;
|
||||
int? danmu;
|
||||
|
||||
Stat.fromJson(Map<String, dynamic> json) {
|
||||
class VListStat extends BaseStat {
|
||||
VListStat.fromJson(Map<String, dynamic> json) {
|
||||
view = json["play"];
|
||||
danmu = json['video_review'];
|
||||
}
|
||||
}
|
||||
|
||||
class Owner {
|
||||
Owner({
|
||||
this.mid,
|
||||
this.name,
|
||||
this.face,
|
||||
});
|
||||
int? mid;
|
||||
String? name;
|
||||
String? face;
|
||||
|
||||
Owner.fromJson(Map<String, dynamic> json) {
|
||||
mid = json["mid"];
|
||||
name = json["author"];
|
||||
face = '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,89 +1,26 @@
|
||||
class MemberCoinsDataModel {
|
||||
MemberCoinsDataModel({
|
||||
this.aid,
|
||||
this.bvid,
|
||||
this.cid,
|
||||
this.coins,
|
||||
this.copyright,
|
||||
this.ctime,
|
||||
this.desc,
|
||||
this.duration,
|
||||
this.owner,
|
||||
this.pic,
|
||||
this.pubLocation,
|
||||
this.pubdate,
|
||||
this.resourceType,
|
||||
this.state,
|
||||
this.subtitle,
|
||||
this.time,
|
||||
this.title,
|
||||
this.tname,
|
||||
this.videos,
|
||||
this.view,
|
||||
this.danmaku,
|
||||
});
|
||||
import '../model_hot_video_item.dart';
|
||||
|
||||
int? aid;
|
||||
String? bvid;
|
||||
int? cid;
|
||||
int? coins;
|
||||
int? copyright;
|
||||
int? ctime;
|
||||
String? desc;
|
||||
int? duration;
|
||||
Owner? owner;
|
||||
String? pic;
|
||||
String? pubLocation;
|
||||
int? pubdate;
|
||||
String? resourceType;
|
||||
int? state;
|
||||
class MemberCoinsDataModel extends HotVideoItemModel {
|
||||
String? subtitle;
|
||||
int? coins;
|
||||
int? time;
|
||||
String? title;
|
||||
String? tname;
|
||||
int? videos;
|
||||
int? view;
|
||||
int? danmaku;
|
||||
// int? get view => stat.view;
|
||||
// int? get danmaku => stat.danmu;
|
||||
|
||||
MemberCoinsDataModel.fromJson(Map<String, dynamic> json) {
|
||||
aid = json['aid'];
|
||||
bvid = json['bvid'];
|
||||
cid = json['cid'];
|
||||
MemberCoinsDataModel.fromJson(Map<String, dynamic> json)
|
||||
: super.fromJson(json) {
|
||||
coins = json['coins'];
|
||||
copyright = json['copyright'];
|
||||
ctime = json['ctime'];
|
||||
desc = json['desc'];
|
||||
duration = json['duration'];
|
||||
owner = Owner.fromJson(json['owner']);
|
||||
pic = json['pic'];
|
||||
pubLocation = json['pub_location'];
|
||||
pubdate = json['pubdate'];
|
||||
resourceType = json['resource_type'];
|
||||
state = json['state'];
|
||||
subtitle = json['subtitle'];
|
||||
time = json['time'];
|
||||
title = json['title'];
|
||||
tname = json['tname'];
|
||||
videos = json['videos'];
|
||||
view = json['stat']['view'];
|
||||
danmaku = json['stat']['danmaku'];
|
||||
}
|
||||
}
|
||||
|
||||
class Owner {
|
||||
Owner({
|
||||
this.mid,
|
||||
this.name,
|
||||
this.face,
|
||||
});
|
||||
|
||||
int? mid;
|
||||
String? name;
|
||||
String? face;
|
||||
|
||||
Owner.fromJson(Map<String, dynamic> json) {
|
||||
mid = json['mid'];
|
||||
name = json['name'];
|
||||
face = json['face'];
|
||||
// view = json['stat']['view'];
|
||||
// danmaku = json['stat']['danmaku'];
|
||||
}
|
||||
// @override
|
||||
// String? goto;
|
||||
// @override
|
||||
// bool isFollowed;
|
||||
// @override
|
||||
// String? rcmdReason;
|
||||
// @override
|
||||
// String? uri;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user