mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-06 01:57:45 +08:00
opt change episode
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
import 'package:PiliPlus/models_new/media_list/media_list.dart';
|
||||
|
||||
class MediaListData {
|
||||
List<MediaListItemModel>? mediaList;
|
||||
List<MediaListItemModel> mediaList;
|
||||
bool? hasMore;
|
||||
int? totalCount;
|
||||
String? nextStartKey;
|
||||
|
||||
MediaListData({
|
||||
this.mediaList,
|
||||
required this.mediaList,
|
||||
this.hasMore,
|
||||
this.totalCount,
|
||||
this.nextStartKey,
|
||||
});
|
||||
|
||||
factory MediaListData.fromJson(Map<String, dynamic> json) => MediaListData(
|
||||
mediaList: (json['media_list'] as List<dynamic>?)
|
||||
?.map((e) => MediaListItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
mediaList:
|
||||
(json['media_list'] as List<dynamic>?)
|
||||
?.map((e) => MediaListItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
<MediaListItemModel>[],
|
||||
hasMore: json['has_more'] as bool?,
|
||||
totalCount: json['total_count'] as int?,
|
||||
nextStartKey: json['next_start_key'] as String?,
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import 'package:PiliPlus/models/model_owner.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
||||
import 'package:PiliPlus/models_new/media_list/badge.dart';
|
||||
import 'package:PiliPlus/models_new/media_list/coin.dart';
|
||||
import 'package:PiliPlus/models_new/media_list/ogv_info.dart';
|
||||
import 'package:PiliPlus/models_new/media_list/page.dart';
|
||||
import 'package:PiliPlus/models_new/media_list/rights.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
|
||||
class MediaListItemModel {
|
||||
class MediaListItemModel extends BaseEpisodeItem {
|
||||
@override
|
||||
int? get id => aid;
|
||||
int? aid;
|
||||
int? offset;
|
||||
int? index;
|
||||
String? intro;
|
||||
@@ -17,32 +17,27 @@ class MediaListItemModel {
|
||||
int? tid;
|
||||
int? copyRight;
|
||||
CntInfo? cntInfo;
|
||||
String? cover;
|
||||
int? duration;
|
||||
int? pubtime;
|
||||
int? likeState;
|
||||
int? favState;
|
||||
int? page;
|
||||
List<Page>? pages;
|
||||
String? title;
|
||||
int? type;
|
||||
Owner? upper;
|
||||
String? link;
|
||||
String? bvid;
|
||||
String? shortLink;
|
||||
Rights? rights;
|
||||
dynamic elecInfo;
|
||||
Coin? coin;
|
||||
OgvInfo? ogvInfo;
|
||||
double? progressPercent;
|
||||
Badge? badge;
|
||||
bool? forbidFav;
|
||||
int? moreType;
|
||||
int? businessOid;
|
||||
int? cid;
|
||||
|
||||
MediaListItemModel({
|
||||
this.aid,
|
||||
super.aid,
|
||||
this.offset,
|
||||
this.index,
|
||||
this.intro,
|
||||
@@ -50,29 +45,29 @@ class MediaListItemModel {
|
||||
this.tid,
|
||||
this.copyRight,
|
||||
this.cntInfo,
|
||||
this.cover,
|
||||
super.cover,
|
||||
this.duration,
|
||||
this.pubtime,
|
||||
this.likeState,
|
||||
this.favState,
|
||||
this.page,
|
||||
this.pages,
|
||||
this.title,
|
||||
super.title,
|
||||
this.type,
|
||||
this.upper,
|
||||
this.link,
|
||||
this.bvid,
|
||||
super.bvid,
|
||||
this.shortLink,
|
||||
this.rights,
|
||||
this.elecInfo,
|
||||
this.coin,
|
||||
this.ogvInfo,
|
||||
this.progressPercent,
|
||||
this.badge,
|
||||
super.badge,
|
||||
this.forbidFav,
|
||||
this.moreType,
|
||||
this.businessOid,
|
||||
this.cid,
|
||||
super.cid,
|
||||
});
|
||||
|
||||
MediaListItemModel.fromJson(Map<String, dynamic> json) {
|
||||
@@ -106,7 +101,7 @@ class MediaListItemModel {
|
||||
? null
|
||||
: OgvInfo.fromJson(json['ogv_info']);
|
||||
progressPercent = (json['progress_percent'] as num?)?.toDouble();
|
||||
badge = json['badge'] == null ? null : Badge.fromJson(json['badge']);
|
||||
badge = json['badge']?['text'];
|
||||
forbidFav = json['forbid_fav'] as bool?;
|
||||
moreType = json['more_type'] as int?;
|
||||
businessOid = json['business_oid'] as int?;
|
||||
|
||||
@@ -8,11 +8,9 @@ import 'package:PiliPlus/models_new/video/video_detail/episode.dart'
|
||||
class EpisodeItem extends BaseEpisodeItem {
|
||||
BadgeInfo? badgeInfo;
|
||||
int? badgeType;
|
||||
String? cover;
|
||||
Dimension? dimension;
|
||||
int? duration;
|
||||
bool? enableVt;
|
||||
int? epId;
|
||||
String? from;
|
||||
bool? isViewHide;
|
||||
String? link;
|
||||
@@ -39,11 +37,11 @@ class EpisodeItem extends BaseEpisodeItem {
|
||||
this.badgeType,
|
||||
super.bvid,
|
||||
super.cid,
|
||||
this.cover,
|
||||
super.cover,
|
||||
this.dimension,
|
||||
this.duration,
|
||||
this.enableVt,
|
||||
this.epId,
|
||||
super.epId,
|
||||
this.from,
|
||||
super.id,
|
||||
this.isViewHide,
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
import 'package:PiliPlus/models_new/video/video_detail/arc.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/page.dart';
|
||||
|
||||
abstract class BaseEpisodeItem {
|
||||
class BaseEpisodeItem {
|
||||
int? id;
|
||||
int? aid;
|
||||
int? cid;
|
||||
int? epId;
|
||||
String? bvid;
|
||||
String? badge;
|
||||
String? title;
|
||||
String? cover;
|
||||
|
||||
BaseEpisodeItem({
|
||||
this.id,
|
||||
this.aid,
|
||||
this.cid,
|
||||
this.epId,
|
||||
this.bvid,
|
||||
this.badge,
|
||||
this.title,
|
||||
this.cover,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,6 +30,8 @@ class EpisodeItem extends BaseEpisodeItem {
|
||||
Arc? arc;
|
||||
Part? page;
|
||||
List<Part>? pages;
|
||||
@override
|
||||
String? get cover => arc?.pic;
|
||||
|
||||
EpisodeItem({
|
||||
this.seasonId,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:PiliPlus/models_new/video/video_detail/dimension.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||
|
||||
class Part {
|
||||
int? cid;
|
||||
class Part extends BaseEpisodeItem {
|
||||
int? page;
|
||||
String? from;
|
||||
String? pagePart;
|
||||
@@ -11,10 +11,9 @@ class Part {
|
||||
Dimension? dimension;
|
||||
int? ctime;
|
||||
String? firstFrame;
|
||||
String? badge;
|
||||
|
||||
Part({
|
||||
this.cid,
|
||||
super.cid,
|
||||
this.page,
|
||||
this.from,
|
||||
this.pagePart,
|
||||
@@ -24,7 +23,7 @@ class Part {
|
||||
this.dimension,
|
||||
this.ctime,
|
||||
this.firstFrame,
|
||||
this.badge,
|
||||
super.badge,
|
||||
});
|
||||
|
||||
factory Part.fromJson(Map<String, dynamic> json) => Part(
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
class Choice {
|
||||
int? id;
|
||||
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||
|
||||
class Choice extends BaseEpisodeItem {
|
||||
String? platformAction;
|
||||
String? nativeAction;
|
||||
String? condition;
|
||||
int? cid;
|
||||
String? option;
|
||||
int? isDefault;
|
||||
|
||||
Choice({
|
||||
this.id,
|
||||
super.id,
|
||||
this.platformAction,
|
||||
this.nativeAction,
|
||||
this.condition,
|
||||
this.cid,
|
||||
super.cid,
|
||||
this.option,
|
||||
this.isDefault,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user