mod: try-catch nextplay

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-06 20:28:19 +08:00
parent b7cb977f2b
commit c88776c4a0
2 changed files with 95 additions and 86 deletions

View File

@@ -576,6 +576,7 @@ class BangumiIntroController extends CommonController {
/// 列表循环或者顺序播放时,自动播放下一个;自动连播时,播放相关视频
bool nextPlay() {
try {
late List episodes;
VideoDetailController videoDetailCtr =
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
@@ -608,6 +609,9 @@ class BangumiIntroController extends CommonController {
dynamic cover = episodes[nextIndex].cover;
changeSeasonOrbangu(epid, bvid, cid, aid, cover);
return true;
} catch (_) {
return false;
}
}
bool playRelated() {

View File

@@ -728,6 +728,7 @@ class VideoIntroController extends GetxController
/// 列表循环或者顺序播放时,自动播放下一个
bool nextPlay() {
try {
final List episodes = [];
bool isPages = false;
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 (playRepeat == PlayRepeat.autoPlayRelated &&
@@ -793,6 +795,9 @@ class VideoIntroController extends GetxController
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[nextIndex].aid!;
changeSeasonOrbangu(null, rBvid, cid, rAid, null);
return true;
} catch (_) {
return false;
}
}
bool playRelated() {