handle sub url

Closes #995

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-11 21:11:28 +08:00
parent 17b7eb7e0f
commit be5a1af040
9 changed files with 122 additions and 181 deletions

View File

@@ -1,60 +1,38 @@
import 'package:PiliPlus/models/model_owner.dart';
import 'package:PiliPlus/models_new/sub/sub/list.dart';
class SpaceFavItemModel {
int? id;
class SpaceFavItemModel extends SubItemModel {
int? mediaId;
int? count;
int? isPublic;
int? fid;
int? mid;
int? attr;
String? attrDesc;
String? title;
String? cover;
Owner? upper;
int? coverType;
String? intro;
int? ctime;
int? mtime;
int? state;
int? favState;
int? mediaCount;
int? viewCount;
int? vt;
bool? isTop;
dynamic recentFav;
int? playSwitch;
int? type;
String? link;
String? bvid;
SpaceFavItemModel({
this.id,
super.id,
this.mediaId,
this.count,
this.isPublic,
this.fid,
this.mid,
this.attr,
this.attrDesc,
this.title,
this.cover,
this.upper,
this.coverType,
this.intro,
this.ctime,
this.mtime,
this.state,
this.favState,
this.mediaCount,
this.viewCount,
this.vt,
this.isTop,
this.recentFav,
this.playSwitch,
this.type,
this.link,
this.bvid,
super.fid,
super.mid,
super.attr,
super.attrDesc,
super.title,
super.cover,
super.upper,
super.coverType,
super.intro,
super.ctime,
super.mtime,
super.state,
super.favState,
super.mediaCount,
super.viewCount,
super.vt,
super.isTop,
super.recentFav,
super.playSwitch,
super.type,
super.link,
super.bvid,
});
factory SpaceFavItemModel.fromJson(Map<String, dynamic> json) =>

View File

@@ -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']),
);
}

View File

@@ -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(),

View File

@@ -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?,
);
}