opt models

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-04 15:20:35 +08:00
parent f50b1d2beb
commit b960359a39
858 changed files with 11000 additions and 12588 deletions

View File

@@ -0,0 +1,32 @@
class Badge {
String? text;
String? textColor;
String? textColorNight;
String? bgColor;
String? bgColorNight;
String? borderColor;
String? borderColorNight;
int? bgStyle;
Badge({
this.text,
this.textColor,
this.textColorNight,
this.bgColor,
this.bgColorNight,
this.borderColor,
this.borderColorNight,
this.bgStyle,
});
factory Badge.fromJson(Map<String, dynamic> json) => Badge(
text: json['text'] as String?,
textColor: json['text_color'] as String?,
textColorNight: json['text_color_night'] as String?,
bgColor: json['bg_color'] as String?,
bgColorNight: json['bg_color_night'] as String?,
borderColor: json['border_color'] as String?,
borderColorNight: json['border_color_night'] as String?,
bgStyle: json['bg_style'] as int?,
);
}

View File

@@ -0,0 +1,11 @@
class CursorAttr {
bool? isLastWatchedArc;
int? rank;
CursorAttr({this.isLastWatchedArc, this.rank});
factory CursorAttr.fromJson(Map<String, dynamic> json) => CursorAttr(
isLastWatchedArc: json['is_last_watched_arc'] as bool?,
rank: json['rank'] as int?,
);
}

View File

@@ -0,0 +1,48 @@
import 'package:PiliPlus/models_new/space/space_archive/episodic_button.dart';
import 'package:PiliPlus/models_new/space/space_archive/item.dart';
import 'package:PiliPlus/models_new/space/space_archive/last_watched_locator.dart';
import 'package:PiliPlus/models_new/space/space_archive/order.dart';
class SpaceArchiveData {
EpisodicButton? episodicButton;
List<Order>? order;
int? count;
List<SpaceArchiveItem>? item;
LastWatchedLocator? lastWatchedLocator;
bool? hasNext;
bool? hasPrev;
int? next;
SpaceArchiveData({
this.episodicButton,
this.order,
this.count,
this.item,
this.lastWatchedLocator,
this.hasNext,
this.hasPrev,
this.next,
});
factory SpaceArchiveData.fromJson(Map<String, dynamic> json) =>
SpaceArchiveData(
episodicButton: json['episodic_button'] == null
? null
: EpisodicButton.fromJson(
json['episodic_button'] as Map<String, dynamic>),
order: (json['order'] as List<dynamic>?)
?.map((e) => Order.fromJson(e as Map<String, dynamic>))
.toList(),
count: json['count'] as int?,
item: (json['item'] as List<dynamic>?)
?.map((e) => SpaceArchiveItem.fromJson(e as Map<String, dynamic>))
.toList(),
lastWatchedLocator: json['last_watched_locator'] == null
? null
: LastWatchedLocator.fromJson(
json['last_watched_locator'] as Map<String, dynamic>),
hasNext: json['has_next'] as bool?,
hasPrev: json['has_prev'] as bool?,
next: json['next'],
);
}

View File

@@ -0,0 +1,13 @@
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?,
);
}
}

View File

@@ -0,0 +1,11 @@
class History {
int? progress;
int? duration;
History({this.progress, this.duration});
factory History.fromJson(Map<String, dynamic> json) => History(
progress: json['progress'] as int?,
duration: json['duration'] as int?,
);
}

View File

@@ -0,0 +1,79 @@
import 'package:PiliPlus/models/model_owner.dart';
import 'package:PiliPlus/models/model_video.dart';
import 'package:PiliPlus/models_new/space/space_archive/badge.dart';
import 'package:PiliPlus/models_new/space/space_archive/cursor_attr.dart';
import 'package:PiliPlus/models_new/space/space_archive/history.dart';
import 'package:PiliPlus/models_new/space/space_archive/season.dart';
class SpaceArchiveItem extends BaseSimpleVideoItemModel {
String? subtitle;
String? tname;
String? coverIcon;
String? uri;
String? param;
String? goto;
String? length;
bool? isPopular;
bool? isSteins;
bool? isUgcpay;
bool? isCooperation;
bool? isPgc;
bool? isLivePlayback;
bool? isPugv;
bool? isFold;
bool? isOneself;
int? ctime;
int? ugcPay;
bool? state;
int? videos;
CursorAttr? cursorAttr;
int? iconType;
String? publishTimeText;
List<Badge>? badges;
SpaceArchiveSeason? season;
History? history;
SpaceArchiveItem.fromJson(Map<String, dynamic> json) {
title = json['title'];
subtitle = json['subtitle'];
tname = json['tname'];
cover = json['cover'];
coverIcon = json['cover_icon'];
uri = json['uri'];
param = json['param'];
goto = json['goto'];
length = json['length'];
duration = json['duration'] ?? -1;
isPopular = json['is_popular'];
isSteins = json['is_steins'];
isUgcpay = json['is_ugcpay'];
isCooperation = json['is_cooperation'];
isPgc = json['is_pgc'];
isLivePlayback = json['is_live_playback'];
isPugv = json['is_pugv'];
isFold = json['is_fold'];
isOneself = json['is_oneself'];
ctime = json['ctime'];
ugcPay = json['ugc_pay'];
state = json['state'];
bvid = json['bvid'];
videos = json['videos'];
cid = json['first_cid'];
cursorAttr = json['cursor_attr'] == null
? null
: CursorAttr.fromJson(json['cursor_attr'] as Map<String, dynamic>);
iconType = json['icon_type'];
publishTimeText = json['publish_time_text'];
badges = (json['badges'] as List<dynamic>?)
?.map((e) => Badge.fromJson(e as Map<String, dynamic>))
.toList();
history = json['history'] == null
? null
: History.fromJson(json['history'] as Map<String, dynamic>);
season = json['season'] == null
? null
: SpaceArchiveSeason.fromJson(json['season'] as Map<String, dynamic>);
stat = PlayStat.fromJson(json);
owner = Owner(mid: 0, name: json['author']);
}
}

View File

@@ -0,0 +1,19 @@
class LastWatchedLocator {
int? displayThreshold;
int? insertRanking;
String? text;
LastWatchedLocator({
this.displayThreshold,
this.insertRanking,
this.text,
});
factory LastWatchedLocator.fromJson(Map<String, dynamic> json) {
return LastWatchedLocator(
displayThreshold: json['display_threshold'] as int?,
insertRanking: json['insert_ranking'] as int?,
text: json['text'] as String?,
);
}
}

View File

@@ -0,0 +1,11 @@
class Order {
String? title;
String? value;
Order({this.title, this.value});
factory Order.fromJson(Map<String, dynamic> json) => Order(
title: json['title'] as String?,
value: json['value'] as String?,
);
}

View File

@@ -0,0 +1,12 @@
class SpaceArchiveSeason {
dynamic mtime;
SpaceArchiveSeason({
this.mtime,
});
factory SpaceArchiveSeason.fromJson(Map<String, dynamic> json) =>
SpaceArchiveSeason(
mtime: json['mtime'],
);
}

View File

@@ -0,0 +1,15 @@
class SpaceArchiveStat {
String? viewStr;
String? danmuStr;
SpaceArchiveStat({
this.viewStr,
this.danmuStr,
});
factory SpaceArchiveStat.fromJson(Map<String, dynamic> json) =>
SpaceArchiveStat(
viewStr: json['view_str'],
danmuStr: json['danmu_str'],
);
}