mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-01 15:49:49 +08:00
@@ -1,22 +1,13 @@
|
||||
import 'package:PiliPlus/models_new/member/search_archive/episodic_button.dart';
|
||||
import 'package:PiliPlus/models_new/member/search_archive/list.dart';
|
||||
import 'package:PiliPlus/models_new/member/search_archive/page.dart';
|
||||
|
||||
class SearchArchiveData {
|
||||
SearchArchiveList? list;
|
||||
Page? page;
|
||||
EpisodicButton? episodicButton;
|
||||
bool? isRisk;
|
||||
int? gaiaResType;
|
||||
dynamic gaiaData;
|
||||
|
||||
SearchArchiveData({
|
||||
this.list,
|
||||
this.page,
|
||||
this.episodicButton,
|
||||
this.isRisk,
|
||||
this.gaiaResType,
|
||||
this.gaiaData,
|
||||
});
|
||||
|
||||
factory SearchArchiveData.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -27,13 +18,5 @@ class SearchArchiveData {
|
||||
page: json['page'] == null
|
||||
? null
|
||||
: Page.fromJson(json['page'] as Map<String, dynamic>),
|
||||
episodicButton: json['episodic_button'] == null
|
||||
? null
|
||||
: EpisodicButton.fromJson(
|
||||
json['episodic_button'] as Map<String, dynamic>,
|
||||
),
|
||||
isRisk: json['is_risk'] as bool?,
|
||||
gaiaResType: json['gaia_res_type'] as int?,
|
||||
gaiaData: json['gaia_data'] as dynamic,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
class EpisodicButton {
|
||||
String? text;
|
||||
String? uri;
|
||||
|
||||
EpisodicButton({this.text, this.uri});
|
||||
|
||||
factory EpisodicButton.fromJson(Map<String, dynamic> json) {
|
||||
return EpisodicButton(
|
||||
text: json['text'] as String?,
|
||||
uri: json['uri'] as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,26 @@
|
||||
import 'package:PiliPlus/models_new/member/search_archive/slist.dart';
|
||||
import 'package:PiliPlus/models_new/member/search_archive/vlist.dart';
|
||||
|
||||
class SearchArchiveList {
|
||||
List<ListTag>? tags;
|
||||
List<VListItemModel>? vlist;
|
||||
|
||||
SearchArchiveList({this.vlist});
|
||||
|
||||
factory SearchArchiveList.fromJson(Map<String, dynamic> json) =>
|
||||
SearchArchiveList(
|
||||
vlist: (json['vlist'] as List<dynamic>?)
|
||||
?.map((e) => VListItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
SearchArchiveList.fromJson(Map<String, dynamic> json) {
|
||||
vlist = (json['vlist'] as List<dynamic>?)
|
||||
?.map((e) => VListItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
tags = (json['slist'] as List<dynamic>?)
|
||||
?.map((e) => ListTag.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
(json['tlist'] as Map<String, dynamic>?)?.forEach((k, v) {
|
||||
if (k == '196') {
|
||||
if (tags == null) {
|
||||
tags = [ListTag.fromJson(v)];
|
||||
} else {
|
||||
tags!.add(ListTag.fromJson(v));
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
15
lib/models_new/member/search_archive/slist.dart
Normal file
15
lib/models_new/member/search_archive/slist.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class ListTag {
|
||||
int? tid;
|
||||
int? count;
|
||||
String? name;
|
||||
String? specialType;
|
||||
|
||||
ListTag({this.tid, this.count, this.name, this.specialType});
|
||||
|
||||
factory ListTag.fromJson(Map<String, dynamic> json) => ListTag(
|
||||
tid: json['tid'] as int?,
|
||||
count: json['count'] as int?,
|
||||
name: json['name'] as String?,
|
||||
specialType: json['special_type'] as String?,
|
||||
);
|
||||
}
|
||||
@@ -2,31 +2,16 @@ import 'package:PiliPlus/models/model_video.dart';
|
||||
import 'package:PiliPlus/utils/duration_utils.dart';
|
||||
|
||||
class VListItemModel extends BaseVideoItemModel {
|
||||
int? comment;
|
||||
int? typeid;
|
||||
String? subtitle;
|
||||
String? copyright;
|
||||
int? review;
|
||||
bool? hideClick;
|
||||
bool? isChargingSrc;
|
||||
|
||||
VListItemModel.fromJson(Map<String, dynamic> json) {
|
||||
comment = json['comment'];
|
||||
typeid = json['typeid'];
|
||||
cover = json['pic'];
|
||||
subtitle = json['subtitle'];
|
||||
desc = json['description'];
|
||||
copyright = json['copyright'];
|
||||
title = json['title'];
|
||||
review = json['review'];
|
||||
pubdate = json['created'];
|
||||
if (json['length'] != null) {
|
||||
duration = DurationUtils.parseDuration(json['length']);
|
||||
}
|
||||
aid = json['aid'];
|
||||
bvid = json['bvid'];
|
||||
hideClick = json['hide_click'];
|
||||
isChargingSrc = json['is_charging_arc'];
|
||||
stat = VListStat.fromJson(json);
|
||||
owner = VListOwner.fromJson(json);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user