feat: 相关视频推荐开关 issues #585

This commit is contained in:
guozhigq
2024-03-11 23:31:20 +08:00
parent 3ece2bb173
commit 99e6abdad9
4 changed files with 15 additions and 3 deletions

View File

@ -173,6 +173,12 @@ class _ExtraSettingState extends State<ExtraSetting> {
setKey: SettingBoxKey.enableAi,
defaultVal: true,
),
const SetSwitchItem(
title: '相关视频推荐',
subTitle: '视频详情页推荐相关视频',
setKey: SettingBoxKey.enableRelatedVideo,
defaultVal: true,
),
ListTile(
dense: false,
title: Text('评论展示', style: titleStyle),

View File

@ -91,6 +91,7 @@ class VideoDetailController extends GetxController
late int cacheAudioQa;
PersistentBottomSheetController? replyReplyBottomSheetCtr;
late bool enableRelatedVideo;
@override
void onInit() {
@ -113,7 +114,8 @@ class VideoDetailController extends GetxController
autoPlay.value =
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: true);
enableHA.value = setting.get(SettingBoxKey.enableHA, defaultValue: true);
enableRelatedVideo =
setting.get(SettingBoxKey.enableRelatedVideo, defaultValue: true);
if (userInfo == null ||
localCache.get(LocalCacheKey.historyPause) == true) {
enableHeart = false;

View File

@ -521,7 +521,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
.withOpacity(0.06),
),
),
const RelatedVideoPanel(),
if (videoDetailController.videoType ==
SearchType.video &&
videoDetailController.enableRelatedVideo)
const RelatedVideoPanel(),
],
);
},