mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: try-catch nextplay
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -576,6 +576,7 @@ class BangumiIntroController extends CommonController {
|
|||||||
|
|
||||||
/// 列表循环或者顺序播放时,自动播放下一个;自动连播时,播放相关视频
|
/// 列表循环或者顺序播放时,自动播放下一个;自动连播时,播放相关视频
|
||||||
bool nextPlay() {
|
bool nextPlay() {
|
||||||
|
try {
|
||||||
late List episodes;
|
late List episodes;
|
||||||
VideoDetailController videoDetailCtr =
|
VideoDetailController videoDetailCtr =
|
||||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
||||||
@@ -608,6 +609,9 @@ class BangumiIntroController extends CommonController {
|
|||||||
dynamic cover = episodes[nextIndex].cover;
|
dynamic cover = episodes[nextIndex].cover;
|
||||||
changeSeasonOrbangu(epid, bvid, cid, aid, cover);
|
changeSeasonOrbangu(epid, bvid, cid, aid, cover);
|
||||||
return true;
|
return true;
|
||||||
|
} catch (_) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool playRelated() {
|
bool playRelated() {
|
||||||
|
|||||||
@@ -728,6 +728,7 @@ class VideoIntroController extends GetxController
|
|||||||
|
|
||||||
/// 列表循环或者顺序播放时,自动播放下一个
|
/// 列表循环或者顺序播放时,自动播放下一个
|
||||||
bool nextPlay() {
|
bool nextPlay() {
|
||||||
|
try {
|
||||||
final List episodes = [];
|
final List episodes = [];
|
||||||
bool isPages = false;
|
bool isPages = false;
|
||||||
final videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
final videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
||||||
@@ -748,7 +749,8 @@ class VideoIntroController extends GetxController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final PlayRepeat playRepeat = videoDetailCtr.plPlayerController.playRepeat;
|
final PlayRepeat playRepeat =
|
||||||
|
videoDetailCtr.plPlayerController.playRepeat;
|
||||||
|
|
||||||
if (episodes.isEmpty) {
|
if (episodes.isEmpty) {
|
||||||
if (playRepeat == PlayRepeat.autoPlayRelated &&
|
if (playRepeat == PlayRepeat.autoPlayRelated &&
|
||||||
@@ -793,6 +795,9 @@ class VideoIntroController extends GetxController
|
|||||||
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[nextIndex].aid!;
|
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[nextIndex].aid!;
|
||||||
changeSeasonOrbangu(null, rBvid, cid, rAid, null);
|
changeSeasonOrbangu(null, rBvid, cid, rAid, null);
|
||||||
return true;
|
return true;
|
||||||
|
} catch (_) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool playRelated() {
|
bool playRelated() {
|
||||||
|
|||||||
Reference in New Issue
Block a user