From c41955952e0f2bade0ea9654f78c949a3a6acb0f Mon Sep 17 00:00:00 2001 From: mtvpls Date: Sat, 21 Mar 2026 12:08:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=A4=9A=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/admin/page.tsx | 24 ++++++++++++++------- src/lib/source-script.ts | 45 ++++++++++++++++++++++++++++++++-------- 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 3346c7f..48c50be 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -6001,9 +6001,9 @@ const VideoSourceScriptLab = () => { enabled: true, history: [], }); - const [testHook, setTestHook] = useState<'search' | 'detail' | 'resolvePlayUrl'>('search'); + const [testHook, setTestHook] = useState<'getSources' | 'search' | 'recommend' | 'detail' | 'resolvePlayUrl'>('getSources'); const [testPayload, setTestPayload] = useState( - JSON.stringify({ keyword: '凡人修仙传', page: 1 }, null, 2) + JSON.stringify({}, null, 2) ); const [testOutput, setTestOutput] = useState(''); const importInputRef = useRef(null); @@ -6302,13 +6302,18 @@ const VideoSourceScriptLab = () => { useEffect(() => { setTestPayload( - testHook === 'search' - ? JSON.stringify({ keyword: '凡人修仙传', page: 1 }, null, 2) + testHook === 'getSources' + ? JSON.stringify({}, null, 2) + : testHook === 'search' + ? JSON.stringify({ keyword: '凡人修仙传', page: 1, sourceId: 'main' }, null, 2) + : testHook === 'recommend' + ? JSON.stringify({ page: 1 }, null, 2) : testHook === 'detail' - ? JSON.stringify({ id: 'demo-id' }, null, 2) + ? JSON.stringify({ id: 'demo-id', sourceId: 'main' }, null, 2) : JSON.stringify( { - sourceId: 'demo-id', + sourceId: 'main', + lineId: 'default', playUrl: 'https://example.com/video.m3u8', episodeIndex: 0, }, @@ -6488,14 +6493,19 @@ const VideoSourceScriptLab = () => { +

+ 现在脚本可以自己管理多个源和线路,测试入参可传 `sourceId`、`lineId`。 +