mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-14 13:20:17 +08:00
handle sub url
Closes #995 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:PiliPlus/models/model_owner.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
||||
|
||||
class SubItemModel {
|
||||
int? id;
|
||||
@@ -24,6 +25,7 @@ class SubItemModel {
|
||||
int? type;
|
||||
String? link;
|
||||
String? bvid;
|
||||
CntInfo? cntInfo;
|
||||
|
||||
SubItemModel({
|
||||
this.id,
|
||||
@@ -49,6 +51,7 @@ class SubItemModel {
|
||||
this.type,
|
||||
this.link,
|
||||
this.bvid,
|
||||
this.cntInfo,
|
||||
});
|
||||
|
||||
factory SubItemModel.fromJson(Map<String, dynamic> json) => SubItemModel(
|
||||
@@ -77,5 +80,8 @@ class SubItemModel {
|
||||
type: json['type'] as int?,
|
||||
link: json['link'] as String?,
|
||||
bvid: json['bvid'] as String?,
|
||||
cntInfo: json['cnt_info'] == null
|
||||
? null
|
||||
: CntInfo.fromJson(json['cnt_info']),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import "package:PiliPlus/models_new/sub/sub_detail/info.dart";
|
||||
import 'package:PiliPlus/models_new/sub/sub/list.dart';
|
||||
import 'package:PiliPlus/models_new/sub/sub_detail/media.dart';
|
||||
|
||||
class SubDetailData {
|
||||
Info? info;
|
||||
SubItemModel? info;
|
||||
List<SubDetailItemModel>? medias;
|
||||
|
||||
SubDetailData({this.info, this.medias});
|
||||
@@ -10,7 +10,7 @@ class SubDetailData {
|
||||
factory SubDetailData.fromJson(Map<String, dynamic> json) => SubDetailData(
|
||||
info: json['info'] == null
|
||||
? null
|
||||
: Info.fromJson(json['info'] as Map<String, dynamic>),
|
||||
: SubItemModel.fromJson(json['info'] as Map<String, dynamic>),
|
||||
medias: (json['medias'] as List<dynamic>?)
|
||||
?.map((e) => SubDetailItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
import 'package:PiliPlus/models/model_owner.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
||||
|
||||
class Info {
|
||||
int? id;
|
||||
int? seasonType;
|
||||
String? title;
|
||||
String? cover;
|
||||
Owner? upper;
|
||||
CntInfo? cntInfo;
|
||||
int? mediaCount;
|
||||
String? intro;
|
||||
int? enableVt;
|
||||
|
||||
Info({
|
||||
this.id,
|
||||
this.seasonType,
|
||||
this.title,
|
||||
this.cover,
|
||||
this.upper,
|
||||
this.cntInfo,
|
||||
this.mediaCount,
|
||||
this.intro,
|
||||
this.enableVt,
|
||||
});
|
||||
|
||||
factory Info.fromJson(Map<String, dynamic> json) => Info(
|
||||
id: json['id'] as int?,
|
||||
seasonType: json['season_type'] as int?,
|
||||
title: json['title'] as String?,
|
||||
cover: json['cover'] as String?,
|
||||
upper: json['upper'] == null
|
||||
? null
|
||||
: Owner.fromJson(json['upper'] as Map<String, dynamic>),
|
||||
cntInfo: json['cnt_info'] == null
|
||||
? null
|
||||
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
|
||||
mediaCount: json['media_count'] as int?,
|
||||
intro: json['intro'] as String?,
|
||||
enableVt: json['enable_vt'] as int?,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user