mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 08:08:19 +08:00
30
lib/models_new/video/video_play_info/data.dart
Normal file
30
lib/models_new/video/video_play_info/data.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:PiliPlus/models_new/video/video_play_info/interaction.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_play_info/subtitle_info.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_play_info/view_point.dart';
|
||||
|
||||
class PlayInfoData {
|
||||
int? lastPlayCid;
|
||||
SubtitleInfo? subtitle;
|
||||
List<ViewPoint>? viewPoints;
|
||||
Interaction? interaction;
|
||||
|
||||
PlayInfoData({
|
||||
this.lastPlayCid,
|
||||
this.subtitle,
|
||||
this.viewPoints,
|
||||
this.interaction,
|
||||
});
|
||||
|
||||
factory PlayInfoData.fromJson(Map<String, dynamic> json) => PlayInfoData(
|
||||
lastPlayCid: json['last_play_cid'] as int?,
|
||||
subtitle: json['subtitle'] == null
|
||||
? null
|
||||
: SubtitleInfo.fromJson(json['subtitle'] as Map<String, dynamic>),
|
||||
viewPoints: (json['view_points'] as List?)
|
||||
?.map((e) => ViewPoint.fromJson(e))
|
||||
.toList(),
|
||||
interaction: json["interaction"] == null
|
||||
? null
|
||||
: Interaction.fromJson(json["interaction"]),
|
||||
);
|
||||
}
|
||||
34
lib/models_new/video/video_play_info/interaction.dart
Normal file
34
lib/models_new/video/video_play_info/interaction.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
class Interaction {
|
||||
HistoryNode? historyNode;
|
||||
int? graphVersion;
|
||||
|
||||
Interaction({
|
||||
this.historyNode,
|
||||
this.graphVersion,
|
||||
});
|
||||
|
||||
factory Interaction.fromJson(Map<String, dynamic> json) => Interaction(
|
||||
historyNode: json["history_node"] == null
|
||||
? null
|
||||
: HistoryNode.fromJson(json["history_node"]),
|
||||
graphVersion: json["graph_version"],
|
||||
);
|
||||
}
|
||||
|
||||
class HistoryNode {
|
||||
int? nodeId;
|
||||
String? title;
|
||||
int? cid;
|
||||
|
||||
HistoryNode({
|
||||
this.nodeId,
|
||||
this.title,
|
||||
this.cid,
|
||||
});
|
||||
|
||||
factory HistoryNode.fromJson(Map<String, dynamic> json) => HistoryNode(
|
||||
nodeId: json["node_id"],
|
||||
title: json["title"],
|
||||
cid: json["cid"],
|
||||
);
|
||||
}
|
||||
20
lib/models_new/video/video_play_info/subtitle.dart
Normal file
20
lib/models_new/video/video_play_info/subtitle.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
class Subtitle {
|
||||
String? lan;
|
||||
String? lanDoc;
|
||||
String? subtitleUrl;
|
||||
String? subtitleUrlV2;
|
||||
|
||||
Subtitle({
|
||||
this.lan,
|
||||
this.lanDoc,
|
||||
this.subtitleUrl,
|
||||
this.subtitleUrlV2,
|
||||
});
|
||||
|
||||
factory Subtitle.fromJson(Map<String, dynamic> json) => Subtitle(
|
||||
lan: json["lan"],
|
||||
lanDoc: json["lan_doc"],
|
||||
subtitleUrl: json["subtitle_url"],
|
||||
subtitleUrlV2: json["subtitle_url_v2"],
|
||||
);
|
||||
}
|
||||
17
lib/models_new/video/video_play_info/subtitle_info.dart
Normal file
17
lib/models_new/video/video_play_info/subtitle_info.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:PiliPlus/models_new/video/video_play_info/subtitle.dart';
|
||||
|
||||
class SubtitleInfo {
|
||||
String? lan;
|
||||
String? lanDoc;
|
||||
List<Subtitle>? subtitles;
|
||||
|
||||
SubtitleInfo({this.lan, this.lanDoc, this.subtitles});
|
||||
|
||||
factory SubtitleInfo.fromJson(Map<String, dynamic> json) => SubtitleInfo(
|
||||
lan: json['lan'] as String?,
|
||||
lanDoc: json['lan_doc'] as String?,
|
||||
subtitles: (json['subtitles'] as List<dynamic>?)
|
||||
?.map((e) => Subtitle.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
32
lib/models_new/video/video_play_info/view_point.dart
Normal file
32
lib/models_new/video/video_play_info/view_point.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
class ViewPoint {
|
||||
int? type;
|
||||
int? from;
|
||||
int? to;
|
||||
String? content;
|
||||
String? imgUrl;
|
||||
String? logoUrl;
|
||||
String? teamType;
|
||||
String? teamName;
|
||||
|
||||
ViewPoint({
|
||||
this.type,
|
||||
this.from,
|
||||
this.to,
|
||||
this.content,
|
||||
this.imgUrl,
|
||||
this.logoUrl,
|
||||
this.teamType,
|
||||
this.teamName,
|
||||
});
|
||||
|
||||
factory ViewPoint.fromJson(Map<String, dynamic> json) => ViewPoint(
|
||||
type: json["type"],
|
||||
from: json["from"],
|
||||
to: json["to"],
|
||||
content: json["content"],
|
||||
imgUrl: json["imgUrl"],
|
||||
logoUrl: json["logoUrl"],
|
||||
teamType: json["team_type"],
|
||||
teamName: json["team_name"],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user