feat: add option to turn off dynamic interactions (#1798)

* add option to turn off dynamic interactions

* update

Signed-off-by: dom <githubaccount56556@proton.me>

---------

Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
KoishiMoe
2026-01-09 11:35:47 +08:00
committed by GitHub
parent dbc11c36df
commit 836ab311d6
4 changed files with 30 additions and 9 deletions

View File

@@ -170,6 +170,9 @@ class ItemModulesModel {
ModuleBlocked? moduleBlocked; ModuleBlocked? moduleBlocked;
ModuleFold? moduleFold; ModuleFold? moduleFold;
static bool showArgueMsg = Pref.showArgueMsg;
static bool showDynInteraction = Pref.showDynInteraction;
ItemModulesModel.fromJson(Map<String, dynamic> json) { ItemModulesModel.fromJson(Map<String, dynamic> json) {
moduleAuthor = json['module_author'] != null moduleAuthor = json['module_author'] != null
? ModuleAuthorModel.fromJson(json['module_author']) ? ModuleAuthorModel.fromJson(json['module_author'])
@@ -186,12 +189,16 @@ class ItemModulesModel {
moduleFold = json['module_fold'] != null moduleFold = json['module_fold'] != null
? ModuleFold.fromJson(json['module_fold']) ? ModuleFold.fromJson(json['module_fold'])
: null; : null;
moduleInteraction = json['module_interaction'] != null if (showDynInteraction) {
? ModuleInteraction.fromJson(json['module_interaction']) moduleInteraction = json['module_interaction'] != null
: null; ? ModuleInteraction.fromJson(json['module_interaction'])
moduleDispute = json['module_dispute'] != null : null;
? ModuleDispute.fromJson(json['module_dispute']) }
: null; if (showArgueMsg) {
moduleDispute = json['module_dispute'] != null
? ModuleDispute.fromJson(json['module_dispute'])
: null;
}
} }
ItemModulesModel.fromOpusJson(List json) { ItemModulesModel.fromOpusJson(List json) {

View File

@@ -15,7 +15,8 @@ import 'package:PiliPlus/models/common/member/tab_type.dart';
import 'package:PiliPlus/models/common/reply/reply_sort_type.dart'; import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
import 'package:PiliPlus/models/common/sponsor_block/skip_type.dart'; import 'package:PiliPlus/models/common/sponsor_block/skip_type.dart';
import 'package:PiliPlus/models/common/super_resolution_type.dart'; import 'package:PiliPlus/models/common/super_resolution_type.dart';
import 'package:PiliPlus/models/dynamics/result.dart'; import 'package:PiliPlus/models/dynamics/result.dart'
show DynamicsDataModel, ItemModulesModel;
import 'package:PiliPlus/pages/common/slide/common_slide_page.dart'; import 'package:PiliPlus/pages/common/slide/common_slide_page.dart';
import 'package:PiliPlus/pages/home/controller.dart'; import 'package:PiliPlus/pages/home/controller.dart';
import 'package:PiliPlus/pages/hot/controller.dart'; import 'package:PiliPlus/pages/hot/controller.dart';
@@ -404,11 +405,12 @@ List<SettingsModel> get extraSettings => [
); );
}, },
), ),
const SwitchModel( SwitchModel(
title: '显示视频警告/争议信息', title: '显示视频警告/争议信息',
leading: Icon(Icons.warning_amber_rounded), leading: const Icon(Icons.warning_amber_rounded),
setKey: SettingBoxKey.showArgueMsg, setKey: SettingBoxKey.showArgueMsg,
defaultVal: true, defaultVal: true,
onChanged: (val) => ItemModulesModel.showArgueMsg = val,
), ),
const SwitchModel( const SwitchModel(
title: '分P/合集:倒序播放从首集开始播放', title: '分P/合集:倒序播放从首集开始播放',
@@ -973,6 +975,14 @@ List<SettingsModel> get extraSettings => [
} }
}, },
), ),
SwitchModel(
title: '显示动态互动内容',
subtitle: '开启后则在动态卡片底部显示互动内容(如关注的人点赞、热评等)',
leading: const Icon(Icons.quickreply_outlined),
setKey: SettingBoxKey.showDynInteraction,
defaultVal: true,
onChanged: (val) => ItemModulesModel.showDynInteraction = val,
),
NormalModel( NormalModel(
title: '用户页默认展示TAB', title: '用户页默认展示TAB',
leading: const Icon(Icons.tab), leading: const Icon(Icons.tab),

View File

@@ -57,6 +57,7 @@ abstract final class SettingBoxKey {
defaultShowComment = 'defaultShowComment', defaultShowComment = 'defaultShowComment',
replySortType = 'replySortType', replySortType = 'replySortType',
defaultDynamicType = 'defaultDynamicType', defaultDynamicType = 'defaultDynamicType',
showDynInteraction = 'showDynInteraction',
enableHotKey = 'enableHotKey', enableHotKey = 'enableHotKey',
enableSearchRcmd = 'enableSearchRcmd', enableSearchRcmd = 'enableSearchRcmd',
enableQuickFav = 'enableQuickFav', enableQuickFav = 'enableQuickFav',

View File

@@ -270,6 +270,9 @@ abstract final class Pref {
static int get defaultDynamicType => static int get defaultDynamicType =>
_setting.get(SettingBoxKey.defaultDynamicType, defaultValue: 0); _setting.get(SettingBoxKey.defaultDynamicType, defaultValue: 0);
static bool get showDynInteraction =>
_setting.get(SettingBoxKey.showDynInteraction, defaultValue: true);
static double get blockLimit => static double get blockLimit =>
_setting.get(SettingBoxKey.blockLimit, defaultValue: 0.0); _setting.get(SettingBoxKey.blockLimit, defaultValue: 0.0);