Merge branch 'fix-seasonChange'

This commit is contained in:
guozhigq
2024-11-24 22:54:21 +08:00
4 changed files with 48 additions and 40 deletions

View File

@ -88,15 +88,14 @@ class VideoIntroController extends GetxController {
}
// 获取视频简介&分p
Future queryVideoIntro({cover}) async {
Future queryVideoIntro({String? cover, String? type, int? cid}) async {
var result = await VideoHttp.videoIntro(bvid: bvid);
if (result['status']) {
videoDetail.value = result['data']!;
ugcSeason = result['data']!.ugcSeason;
pages.value = result['data']!.pages!;
lastPlayCid.value = videoDetail.value.cid!;
if (pages.isNotEmpty) {
lastPlayCid.value = pages.first.cid!;
if (type == null) {
lastPlayCid.value = cid ?? videoDetail.value.cid!;
}
final VideoDetailController videoDetailCtr =
Get.find<VideoDetailController>(tag: heroTag);
@ -482,7 +481,8 @@ class VideoIntroController extends GetxController {
}
} catch (_) {}
this.bvid = bvid;
await queryVideoIntro(cover: cover);
// 点击切换时优先取当前cid
await queryVideoIntro(cover: cover, cid: cid);
}
void startTimer() {