From 5904f862203b8f805e24fdae5e1592431deae934 Mon Sep 17 00:00:00 2001 From: czy0729 <402731062@qq.com> Date: Tue, 5 Nov 2024 06:56:49 +0800 Subject: [PATCH] - fixed #208 --- .../home/subject/component/icon/game.tsx | 3 +-- .../home/subject/component/icon/online.tsx | 3 +-- .../subject/component/icon/search-disc.tsx | 3 +-- .../home/subject/component/icon/search.tsx | 3 +-- src/screens/home/subject/store/computed.tsx | 18 +++++++------ .../origin-setting/component/cloud/index.tsx | 26 +++++++++++++++++-- src/stores/system/init.ts | 15 ++++++----- 7 files changed, 46 insertions(+), 25 deletions(-) diff --git a/src/screens/home/subject/component/icon/game.tsx b/src/screens/home/subject/component/icon/game.tsx index 2870522a3..65406a469 100644 --- a/src/screens/home/subject/component/icon/game.tsx +++ b/src/screens/home/subject/component/icon/game.tsx @@ -10,7 +10,6 @@ import { Popover } from '@_' import { _ } from '@stores' import { stl } from '@utils' import { obc } from '@utils/decorators' -import { WEB } from '@constants' import { Ctx } from '../../types' import { ACTIONS_MANAGE, HIT_SLOP, ORIGINS_MANAGE } from './ds' import { IconProps } from './types' @@ -22,7 +21,7 @@ function IconGame({ style, children }: IconProps, { $, navigation }: Ctx) { ...$.onlineGameOrigins.map(item => (typeof item === 'object' ? item.name : item)), ORIGINS_MANAGE ] - if (!$.actions.length && !WEB) data.push(ACTIONS_MANAGE) + if (!$.actions.length) data.push(ACTIONS_MANAGE) return ( (typeof item === 'object' ? item.name : item)), ORIGINS_MANAGE ] - if (!$.actions.length && !WEB) data.push(ACTIONS_MANAGE) + if (!$.actions.length) data.push(ACTIONS_MANAGE) return ( (typeof item === 'object' ? item.name : item)), ORIGINS_MANAGE ] - if (!$.actions.length && !WEB) data.push(ACTIONS_MANAGE) + if (!$.actions.length) data.push(ACTIONS_MANAGE) return ( SITES_DS.includes(item.site)) - .forEach(item => { - data.push(item.site) - }) + if (systemStore.setting.showLegalSource) { + // bangumi-data + const { sites = [] } = this.state.bangumiInfo + sites + .filter(item => SITES_DS.includes(item.site)) + .forEach(item => { + data.push(item.site) + }) + } return freeze(data) } @@ -396,7 +398,7 @@ export default class Computed extends State { pressable: boolean value: string }[] = [] - let exist = {} + const exist = {} if (animeInfoTags) { animeInfoTags.forEach(item => { tags.push({ diff --git a/src/screens/user/origin-setting/component/cloud/index.tsx b/src/screens/user/origin-setting/component/cloud/index.tsx index b142e23ce..8ed2f264f 100644 --- a/src/screens/user/origin-setting/component/cloud/index.tsx +++ b/src/screens/user/origin-setting/component/cloud/index.tsx @@ -24,7 +24,7 @@ const Cloud = ({ isLogin, active, onToggle, onDownloaded }) => { const text = useCloud() return useObserver(() => { - const { focusOrigin } = systemStore.setting + const { focusOrigin, showLegalSource } = systemStore.setting return ( <> {/* 同步设置 */} @@ -93,7 +93,7 @@ const Cloud = ({ isLogin, active, onToggle, onDownloaded }) => { value={focusOrigin} onSyncPress={() => { t('设置.切换', { - title: ' 突出源头按钮', + title: '突出源头按钮', checked: !focusOrigin }) @@ -107,6 +107,28 @@ const Cloud = ({ isLogin, active, onToggle, onDownloaded }) => { ])} /> + {/** 显示正版播放源 */} + { + t('设置.切换', { + title: '显示正版播放源', + checked: !showLegalSource + }) + + systemStore.switchSetting('showLegalSource') + }} + /> + } + /> + {/* 显示所有项 */} ('进度'), /** @deprecated 图片质量 */ - quality: MODEL_SETTING_QUALITY.getValue('默认'), + // quality: MODEL_SETTING_QUALITY.getValue('默认'), /** 切页动画 */ transition: MODEL_SETTING_TRANSITION.getValue('水平'), + /** 显示正版播放源 */ + showLegalSource: WEB, + /** 首页列表搜索框 */ homeFilter: true,