mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: view to-view video
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -77,6 +77,20 @@ class VideoCardH extends StatelessWidget {
|
|||||||
SmartDialog.showToast('课堂视频暂不支持播放');
|
SmartDialog.showToast('课堂视频暂不支持播放');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (videoItem.pgcLabel?.isNotEmpty == true &&
|
||||||
|
videoItem.redirectUrl?.isNotEmpty == true) {
|
||||||
|
String? id = RegExp(r'(ep|ss)\d+')
|
||||||
|
.firstMatch(videoItem.redirectUrl)
|
||||||
|
?.group(0);
|
||||||
|
if (id != null) {
|
||||||
|
Utils.viewBangumi(
|
||||||
|
seasonId:
|
||||||
|
id.startsWith('ss') ? id.replaceFirst('ss', '') : null,
|
||||||
|
epId: id.startsWith('ep') ? id.replaceFirst('ep', '') : null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
final int cid =
|
final int cid =
|
||||||
videoItem.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
videoItem.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||||
@@ -114,6 +128,12 @@ class VideoCardH extends StatelessWidget {
|
|||||||
width: maxWidth,
|
width: maxWidth,
|
||||||
height: maxHeight,
|
height: maxHeight,
|
||||||
),
|
),
|
||||||
|
if (videoItem.pgcLabel?.isNotEmpty == true)
|
||||||
|
PBadge(
|
||||||
|
text: videoItem.pgcLabel,
|
||||||
|
top: 6.0,
|
||||||
|
right: 6.0,
|
||||||
|
),
|
||||||
if (videoItem.duration != 0)
|
if (videoItem.duration != 0)
|
||||||
PBadge(
|
PBadge(
|
||||||
text: Utils.timeFormat(videoItem.duration!),
|
text: Utils.timeFormat(videoItem.duration!),
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ class HotVideoItemModel {
|
|||||||
this.isOgv,
|
this.isOgv,
|
||||||
this.rcmdReason,
|
this.rcmdReason,
|
||||||
required this.checked,
|
required this.checked,
|
||||||
|
this.pgcLabel,
|
||||||
|
this.redirectUrl,
|
||||||
});
|
});
|
||||||
|
|
||||||
int? aid;
|
int? aid;
|
||||||
@@ -56,6 +58,8 @@ class HotVideoItemModel {
|
|||||||
bool? isOgv;
|
bool? isOgv;
|
||||||
RcmdReason? rcmdReason;
|
RcmdReason? rcmdReason;
|
||||||
late bool checked;
|
late bool checked;
|
||||||
|
String? pgcLabel;
|
||||||
|
String? redirectUrl;
|
||||||
|
|
||||||
HotVideoItemModel.fromJson(Map<String, dynamic> json) {
|
HotVideoItemModel.fromJson(Map<String, dynamic> json) {
|
||||||
aid = json["aid"];
|
aid = json["aid"];
|
||||||
@@ -86,6 +90,8 @@ class HotVideoItemModel {
|
|||||||
? RcmdReason.fromJson(json['rcmd_reason'])
|
? RcmdReason.fromJson(json['rcmd_reason'])
|
||||||
: null;
|
: null;
|
||||||
checked = false;
|
checked = false;
|
||||||
|
pgcLabel = json['pgc_label'];
|
||||||
|
redirectUrl = json['redirect_url'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ class LaterController extends MultiSelectController {
|
|||||||
List<HotVideoItemModel> list = List<HotVideoItemModel>.from(
|
List<HotVideoItemModel> list = List<HotVideoItemModel>.from(
|
||||||
(loadingState.value as Success).response);
|
(loadingState.value as Success).response);
|
||||||
for (HotVideoItemModel item in list) {
|
for (HotVideoItemModel item in list) {
|
||||||
if (item.cid == null) {
|
if (item.cid == null || item.pgcLabel?.isNotEmpty == true) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
if (item.bvid != list.first.bvid) {
|
if (item.bvid != list.first.bvid) {
|
||||||
|
|||||||
@@ -401,12 +401,11 @@ class Utils {
|
|||||||
// epId episode -> progress episode -> first episode
|
// epId episode -> progress episode -> first episode
|
||||||
EpisodeItem? episode;
|
EpisodeItem? episode;
|
||||||
if (epId != null) {
|
if (epId != null) {
|
||||||
EpisodeItem? e = (result['data'].episodes as List).firstWhereOrNull(
|
episode = (result['data'].episodes as List).firstWhereOrNull(
|
||||||
(item) => item.epId == epId,
|
(item) {
|
||||||
|
return item.epId.toString() == epId.toString();
|
||||||
|
},
|
||||||
);
|
);
|
||||||
if (e != null) {
|
|
||||||
episode = e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
episode ??= (result['data'].episodes as List).firstWhereOrNull(
|
episode ??= (result['data'].episodes as List).firstWhereOrNull(
|
||||||
(item) =>
|
(item) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user