From e01292a8f9ca1342941559c4cce70c3e632e5f28 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 28 Oct 2023 23:51:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=83=A8=E5=88=86=E6=8A=95=E7=A8=BF?= =?UTF-8?q?=E4=B8=8D=E8=BF=9E=E6=92=AD=20issues=20#217?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../video/detail/introduction/controller.dart | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 4bc32d35..4590ec44 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -514,19 +514,7 @@ class VideoIntroController extends GetxController { /// 列表循环或者顺序播放时,自动播放下一个 void nextPlay() { late List episodes; - // if (videoDetail.value.ugcSeason != null) { - // UgcSeason ugcSeason = videoDetail.value.ugcSeason!; - // List sections = ugcSeason.sections!; - // for (int i = 0; i < sections.length; i++) { - // List episodesList = sections[i].episodes!; - // for (int j = 0; j < episodesList.length; j++) { - // if (episodesList[j].cid == lastPlayCid.value) { - // episodes = episodesList; - // continue; - // } - // } - // } - // } + bool isPages = false; if (videoDetail.value.ugcSeason != null) { UgcSeason ugcSeason = videoDetail.value.ugcSeason!; List sections = ugcSeason.sections!; @@ -536,6 +524,11 @@ class VideoIntroController extends GetxController { List episodesList = sections[i].episodes!; episodes.addAll(episodesList); } + } else if (videoDetail.value.pages != null) { + isPages = true; + List pages = videoDetail.value.pages!; + episodes = []; + episodes.addAll(pages); } int currentIndex = episodes.indexWhere((e) => e.cid == lastPlayCid.value); @@ -554,9 +547,9 @@ class VideoIntroController extends GetxController { } } int cid = episodes[nextIndex].cid!; - String bvid = episodes[nextIndex].bvid!; - int aid = episodes[nextIndex].aid!; - changeSeasonOrbangu(bvid, cid, aid); + String rBvid = isPages ? bvid : episodes[nextIndex].bvid; + int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[nextIndex].aid!; + changeSeasonOrbangu(rBvid, cid, rAid); } // 设置关注分组