diff --git a/lib/pages/setting/extra_setting.dart b/lib/pages/setting/extra_setting.dart index 6f1ff07e..520a7c85 100644 --- a/lib/pages/setting/extra_setting.dart +++ b/lib/pages/setting/extra_setting.dart @@ -169,6 +169,12 @@ class _ExtraSettingState extends State { setKey: SettingBoxKey.enableSaveLastData, defaultVal: false, ), + const SetSwitchItem( + title: '启用ai总结', + subTitle: '视频详情页开启ai总结', + setKey: SettingBoxKey.enableAi, + defaultVal: true, + ), ListTile( dense: false, title: Text('评论展示', style: titleStyle), diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 16cacdbf..8de40602 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -568,13 +568,7 @@ class VideoIntroController extends GetxController { upMid: videoDetail.value.owner!.mid!, ); if (res['status']) { - if (res['data'].modelResult.resultType == 0) { - SmartDialog.showToast('该视频不支持ai总结'); - } - if (res['data'].modelResult.resultType == 2 || - res['data'].modelResult.resultType == 1) { - modelResult = res['data'].modelResult; - } + modelResult = res['data'].modelResult; } SmartDialog.dismiss(); return res; diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index 2a9b774d..c6bd7f97 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -134,6 +134,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { late final dynamic followStatus; late int mid; late String memberHeroTag; + late bool enableAi; @override void initState() { @@ -150,6 +151,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { ? '-' : Utils.numFormat(videoIntroController.userStat['follower']); followStatus = videoIntroController.followStatus; + enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true); } // 收藏 @@ -317,23 +319,22 @@ class _VideoInfoState extends State with TickerProviderStateMixin { ), ), ), - Positioned( - right: 10, - top: 6, - child: GestureDetector( - onTap: () async { - var res = await videoIntroController.aiConclusion(); - if (res['status']) { - if (res['data'].modelResult.resultType == 2 || - res['data'].modelResult.resultType == 1) { + if (enableAi) + Positioned( + right: 10, + top: 6, + child: GestureDetector( + onTap: () async { + var res = + await videoIntroController.aiConclusion(); + if (res['status']) { showAiBottomSheet(); } - } - }, - child: - Image.asset('assets/images/ai.png', height: 22), - ), - ) + }, + child: + Image.asset('assets/images/ai.png', height: 22), + ), + ) ], ), // 点赞收藏转发 布局样式1 diff --git a/lib/utils/storage.dart b/lib/utils/storage.dart index 1d20877b..89f352bb 100644 --- a/lib/utils/storage.dart +++ b/lib/utils/storage.dart @@ -138,6 +138,7 @@ class SettingBoxKey { static const String displayMode = 'displayMode'; static const String customRows = 'customRows'; // 自定义列 static const String enableMYBar = 'enableMYBar'; + static const String enableAi = 'enableAi'; } class LocalCacheKey {