Skip to content

Commit

Permalink
- fixed #208
Browse files Browse the repository at this point in the history
  • Loading branch information
czy0729 committed Nov 4, 2024
1 parent e68b10f commit 5904f86
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 25 deletions.
3 changes: 1 addition & 2 deletions src/screens/home/subject/component/icon/game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 (
<Popover
Expand Down
3 changes: 1 addition & 2 deletions src/screens/home/subject/component/icon/online.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ import { Popover } from '@_'
import { _, systemStore } from '@stores'
import { stl } from '@utils'
import { obc } from '@utils/decorators'
import { WEB } from '@constants'
import { Ctx } from '../../types'
import IconActions from './actions'
import { ACTIONS_MANAGE, HIT_SLOP, ICS_MANAGE, ORIGINS_MANAGE } from './ds'
import { IconProps } from './types'

function IconOnline({ style, children }: IconProps, { $, navigation }: Ctx) {
const data = [...$.onlineOrigins, ORIGINS_MANAGE]
if (!$.actions.length && !WEB) data.push(ACTIONS_MANAGE)
if (!$.actions.length) data.push(ACTIONS_MANAGE)
if (systemStore.setting.exportICS) data.push(ICS_MANAGE)

return (
Expand Down
3 changes: 1 addition & 2 deletions src/screens/home/subject/component/icon/search-disc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -20,7 +19,7 @@ function IconSearchDisc({ style, children }: IconProps, { $, navigation }: Ctx)
...$.onlineDiscOrigins.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 (
<Popover
Expand Down
3 changes: 1 addition & 2 deletions src/screens/home/subject/component/icon/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -20,7 +19,7 @@ function IconSearch({ style, children }: IconProps, { $, navigation }: Ctx) {
...$.onlineComicOrigins.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 (
<Popover
Expand Down
18 changes: 10 additions & 8 deletions src/screens/home/subject/store/computed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,15 @@ export default class Computed extends State {
})
}

// bangumi-data
const { sites = [] } = this.state.bangumiInfo
sites
.filter(item => 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)
}
Expand Down Expand Up @@ -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({
Expand Down
26 changes: 24 additions & 2 deletions src/screens/user/origin-setting/component/cloud/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
{/* 同步设置 */}
Expand Down Expand Up @@ -93,7 +93,7 @@ const Cloud = ({ isLogin, active, onToggle, onDownloaded }) => {
value={focusOrigin}
onSyncPress={() => {
t('设置.切换', {
title: ' 突出源头按钮',
title: '突出源头按钮',
checked: !focusOrigin
})

Expand All @@ -107,6 +107,28 @@ const Cloud = ({ isLogin, active, onToggle, onDownloaded }) => {
])}
/>

{/** 显示正版播放源 */}
<ItemSetting
style={styles.item}
contentStyle={styles.content}
hd='显示正版播放源'
information='若有正版播放数据,会在源头选项底部插入 acfun、bilibili、qq、iqiyi、netflix 等播放源头(数据来源自 bangumi-data)'
ft={
<SwitchPro
style={styles.switch}
value={showLegalSource}
onSyncPress={() => {
t('设置.切换', {
title: '显示正版播放源',
checked: !showLegalSource
})

systemStore.switchSetting('showLegalSource')
}}
/>
}
/>

{/* 显示所有项 */}
<ItemSetting
style={styles.item}
Expand Down
15 changes: 8 additions & 7 deletions src/stores/system/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
MODEL_SETTING_HOME_LAYOUT,
MODEL_SETTING_HOME_SORTING,
MODEL_SETTING_INITIAL_PAGE,
MODEL_SETTING_QUALITY,
MODEL_SETTING_TRANSITION,
MODEL_SETTING_USER_GRID_NUM,
VERSION_GITHUB_RELEASE,
Expand All @@ -26,7 +25,6 @@ import {
SettingHomeLayout,
SettingHomeSorting,
SettingInitialPage,
SettingQuality,
SettingTransition,
SettingUserGridNum
} from '@types'
Expand Down Expand Up @@ -163,7 +161,7 @@ export const INIT_SETTING = {
deepDark: true,

/** @deprecated 设置页面显示最基本的设置 */
simple: true,
// simple: true,

/** 头像是否圆形 */
avatarRound: false,
Expand Down Expand Up @@ -193,7 +191,7 @@ export const INIT_SETTING = {
filterDefault: false,

/** @deprecated 扁平化 */
flat: true,
// flat: true,

/** 章节热力图 */
heatMap: true,
Expand All @@ -208,10 +206,10 @@ export const INIT_SETTING = {
imageFadeIn: true,

/** @deprecated iOS 风格弹出菜单 */
iosMenu: false,
// iosMenu: false,

/** @deprecated 首页收藏阴影 */
itemShadow: false,
// itemShadow: false,

/** 片假名终结者 */
katakana: false,
Expand Down Expand Up @@ -259,11 +257,14 @@ export const INIT_SETTING = {
initialPage: MODEL_SETTING_INITIAL_PAGE.getValue<SettingInitialPage>('进度'),

/** @deprecated 图片质量 */
quality: MODEL_SETTING_QUALITY.getValue<SettingQuality>('默认'),
// quality: MODEL_SETTING_QUALITY.getValue<SettingQuality>('默认'),

/** 切页动画 */
transition: MODEL_SETTING_TRANSITION.getValue<SettingTransition>('水平'),

/** 显示正版播放源 */
showLegalSource: WEB,

/** 首页列表搜索框 */
homeFilter: true,

Expand Down

0 comments on commit 5904f86

Please sign in to comment.