refa: settings model (#1773)

* opt: MediaQuery

* refa: settings model
This commit is contained in:
My-Responsitories
2025-12-10 16:41:31 +08:00
committed by GitHub
parent b12bdf2eb8
commit 890dc58dc3
13 changed files with 406 additions and 579 deletions

View File

@@ -1,5 +1,4 @@
import 'package:PiliPlus/http/video.dart';
import 'package:PiliPlus/models/common/settings_type.dart';
import 'package:PiliPlus/pages/rcmd/controller.dart';
import 'package:PiliPlus/pages/setting/models/model.dart';
import 'package:PiliPlus/utils/recommend_filter.dart';
@@ -9,8 +8,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
List<SettingsModel> get recommendSettings => [
const SettingsModel(
settingsType: SettingsType.sw1tch,
const SwitchModel(
title: '首页使用app端推荐',
subtitle: '若web端推荐不太符合预期可尝试切换至app端推荐',
leading: Icon(Icons.model_training_outlined),
@@ -18,8 +16,7 @@ List<SettingsModel> get recommendSettings => [
defaultVal: true,
needReboot: true,
),
SettingsModel(
settingsType: SettingsType.sw1tch,
SwitchModel(
title: '保留首页推荐刷新',
subtitle: '下拉刷新时保留上次内容',
leading: const Icon(Icons.refresh),
@@ -35,8 +32,7 @@ List<SettingsModel> get recommendSettings => [
}
},
),
SettingsModel(
settingsType: SettingsType.sw1tch,
SwitchModel(
title: '显示上次看到位置提示',
subtitle: '保留上次推荐时,在上次刷新位置显示提示',
leading: const Icon(Icons.tips_and_updates_outlined),
@@ -53,7 +49,6 @@ List<SettingsModel> get recommendSettings => [
},
),
getVideoFilterSelectModel(
context: Get.context!,
title: '点赞率',
suffix: '%',
key: SettingBoxKey.minLikeRatioForRecommend,
@@ -61,7 +56,6 @@ List<SettingsModel> get recommendSettings => [
onChanged: (value) => RecommendFilter.minLikeRatioForRecommend = value,
),
getBanwordModel(
context: Get.context!,
title: '标题关键词过滤',
key: SettingBoxKey.banWordForRecommend,
onChanged: (value) {
@@ -70,7 +64,6 @@ List<SettingsModel> get recommendSettings => [
},
),
getBanwordModel(
context: Get.context!,
title: 'App推荐/热门/排行榜: 视频分区关键词过滤',
key: SettingBoxKey.banWordForZone,
onChanged: (value) {
@@ -79,7 +72,6 @@ List<SettingsModel> get recommendSettings => [
},
),
getVideoFilterSelectModel(
context: Get.context!,
title: '视频时长',
suffix: 's',
key: SettingBoxKey.minDurationForRcmd,
@@ -87,14 +79,12 @@ List<SettingsModel> get recommendSettings => [
onChanged: (value) => RecommendFilter.minDurationForRcmd = value,
),
getVideoFilterSelectModel(
context: Get.context!,
title: '播放量',
key: SettingBoxKey.minPlayForRcmd,
values: [0, 50, 100, 500, 1000],
onChanged: (value) => RecommendFilter.minPlayForRcmd = value,
),
SettingsModel(
settingsType: SettingsType.sw1tch,
SwitchModel(
title: '已关注UP豁免推荐过滤',
subtitle: '推荐中已关注用户发布的内容不会被过滤',
leading: const Icon(Icons.favorite_border_outlined),
@@ -104,8 +94,7 @@ List<SettingsModel> get recommendSettings => [
RecommendFilter.exemptFilterForFollowed = value;
},
),
SettingsModel(
settingsType: SettingsType.sw1tch,
SwitchModel(
title: '过滤器也应用于相关视频',
subtitle: '视频详情页的相关视频也进行过滤¹',
leading: const Icon(Icons.explore_outlined),