From cf2d501c511483e82a5d55b07eb7629f93467bc7 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Fri, 22 Nov 2024 21:26:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/components/contents/bili.jsx | 35 ++++++++++++++++---------- server/components/contents/ncm.jsx | 15 ++--------- server/components/contents/youtube.jsx | 12 ++++++--- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/server/components/contents/bili.jsx b/server/components/contents/bili.jsx index 2184832..61a0a46 100644 --- a/server/components/contents/bili.jsx +++ b/server/components/contents/bili.jsx @@ -1,4 +1,5 @@ import { useState, useEffect } from 'react'; +import { BILI_CDN_SELECT_LIST, BILI_DOWNLOAD_METHOD, BILI_RESOLUTION_LIST } from "../../../constants/constant.js"; import { readYamlConfig, updateYamlConfig } from '../../utils/yamlHelper'; export default function Bili() { @@ -235,9 +236,13 @@ export default function Bili() { className="select select-bordered" value={config.biliCDN} onChange={(e) => setConfig({ ...config, biliCDN: parseInt(e.target.value) })}> - - - + { + BILI_CDN_SELECT_LIST.map(item => { + return ( + + ) + }) + }
@@ -248,10 +253,13 @@ export default function Bili() { className="select select-bordered" value={config.biliDownloadMethod} onChange={(e) => setConfig({ ...config, biliDownloadMethod: parseInt(e.target.value) })}> - - - - + { + BILI_DOWNLOAD_METHOD.map(item => { + return ( + + ) + }) + }
@@ -262,12 +270,13 @@ export default function Bili() { className="select select-bordered" value={config.biliResolution} onChange={(e) => setConfig({ ...config, biliResolution: parseInt(e.target.value) })}> - - - - - - + { + BILI_RESOLUTION_LIST.map(item => { + return ( + + ) + }) + }
diff --git a/server/components/contents/ncm.jsx b/server/components/contents/ncm.jsx index acbd154..77b6b7b 100644 --- a/server/components/contents/ncm.jsx +++ b/server/components/contents/ncm.jsx @@ -1,4 +1,5 @@ import { useState, useEffect } from 'react'; +import { NETEASECLOUD_QUALITY_LIST } from "../../../constants/constant.js"; import { readYamlConfig, updateYamlConfig } from '../../utils/yamlHelper'; export default function Ncm() { @@ -81,18 +82,6 @@ export default function Ncm() { } }; - const audioQualityOptions = [ - { value: 'standard', label: '标准' }, - { value: 'higher', label: '较高' }, - { value: 'exhigh', label: '极高' }, - { value: 'lossless', label: '无损' }, - { value: 'hires', label: 'Hi-Res' }, - { value: 'jyeffect', label: '高清环绕声' }, - { value: 'sky', label: '沉浸环绕声' }, - { value: 'dolby', label: '杜比全景声' }, - { value: 'jymaster', label: '超清母带' } - ]; - return (
{/* 成功提示 */} @@ -208,7 +197,7 @@ export default function Ncm() { className="select select-bordered" value={config.neteaseCloudAudioQuality} onChange={(e) => setConfig({ ...config, neteaseCloudAudioQuality: e.target.value })}> - {audioQualityOptions.map(option => ( + {NETEASECLOUD_QUALITY_LIST.map(option => ( diff --git a/server/components/contents/youtube.jsx b/server/components/contents/youtube.jsx index d460af7..107a7ce 100644 --- a/server/components/contents/youtube.jsx +++ b/server/components/contents/youtube.jsx @@ -1,4 +1,5 @@ import { useState, useEffect } from 'react'; +import { BILI_CDN_SELECT_LIST, YOUTUBE_GRAPHICS_LIST } from "../../../constants/constant.js"; import { readYamlConfig, updateYamlConfig } from '../../utils/yamlHelper'; export default function Youtube() { @@ -107,10 +108,13 @@ export default function Youtube() { className="select select-bordered" value={config.youtubeGraphicsOptions} onChange={(e) => setConfig({ ...config, youtubeGraphicsOptions: parseInt(e.target.value) })}> - - - - + { + YOUTUBE_GRAPHICS_LIST.map(item => { + return ( + + ) + }) + }