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() {
|
||||
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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user