From 2556290a6e6e560d61ac816ddfab0fe5c62eccd6 Mon Sep 17 00:00:00 2001 From: My-Responsitories <107370289+My-Responsitories@users.noreply.github.com> Date: Tue, 11 Mar 2025 13:59:31 +0800 Subject: [PATCH] fix #424 --- .../video/detail/introduction/controller.dart | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 92dc3088..fb34f970 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -630,32 +630,36 @@ class VideoIntroController extends GetxController ..cid.value = cid ..danmakuCid.value = cid ..queryVideoUrl(); - if (cover is String && cover.isNotEmpty) { - videoDetailCtr.videoItem['pic'] = cover; + + if (this.bvid != bvid) { + if (cover is String && cover.isNotEmpty) { + videoDetailCtr.videoItem['pic'] = cover; + } + + // 重新请求相关视频 + if (videoDetailCtr.showRelatedVideo) { + try { + Get.find(tag: heroTag) + ..bvid = bvid + ..queryData(); + } catch (_) {} + } + + // 重新请求评论 + if (videoDetailCtr.showReply) { + try { + Get.find(tag: heroTag) + ..aid = aid + ..onReload(); + } catch (_) {} + } + + hasLater.value = false; + this.bvid = bvid; + queryVideoIntro(); } - // 重新请求相关视频 - if (videoDetailCtr.showRelatedVideo && isStein != true) { - try { - Get.find(tag: heroTag) - ..bvid = bvid - ..queryData(); - } catch (_) {} - } - - // 重新请求评论 - if (videoDetailCtr.showReply && isStein != true) { - try { - Get.find(tag: heroTag) - ..aid = aid - ..onReload(); - } catch (_) {} - } - - hasLater.value = false; - this.bvid = bvid; lastPlayCid.value = cid; - queryVideoIntro(); queryOnlineTotal(); }