From 7f67f57031d3941a1602079924a4079c85cbb33e Mon Sep 17 00:00:00 2001 From: xream Date: Sat, 17 May 2025 20:22:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=95=E6=9D=A1=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E5=92=8C=E6=96=87=E4=BB=B6=E6=94=AF=E6=8C=81=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E5=8F=82=E6=95=B0=20produceType=20raw,=20=E6=AD=A4=E6=97=B6?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=8E=9F=E5=A7=8B=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/restful/file.js | 6 ++++++ backend/src/restful/sync.js | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 38ef082..fb1a067 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.19.40", + "version": "2.19.41", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/restful/file.js b/backend/src/restful/file.js index 1744f5e..4423ac3 100644 --- a/backend/src/restful/file.js +++ b/backend/src/restful/file.js @@ -64,6 +64,7 @@ async function getFile(req, res) { ignoreFailedRemoteFile, proxy, noCache, + produceType, } = req.query; let $options = { _req: { @@ -128,6 +129,10 @@ async function getFile(req, res) { if (noCache) { $.info(`指定不使用缓存: ${noCache}`); } + if (produceType) { + produceType = decodeURIComponent(produceType); + $.info(`指定生产类型: ${produceType}`); + } const allFiles = $.read(FILES_KEY); const file = findByName(allFiles, name); @@ -144,6 +149,7 @@ async function getFile(req, res) { $options, proxy, noCache, + produceType, }); try { diff --git a/backend/src/restful/sync.js b/backend/src/restful/sync.js index 899e52d..4a55914 100644 --- a/backend/src/restful/sync.js +++ b/backend/src/restful/sync.js @@ -173,6 +173,9 @@ async function produceArtifact({ raw.push(sub.content); } } + if (produceType === 'raw') { + return (Array.isArray(raw) ? raw : [raw]).flat(); + } // parse proxies let proxies = (Array.isArray(raw) ? raw : [raw]) .map((i) => ProxyUtils.parse(i)) @@ -570,6 +573,9 @@ async function produceArtifact({ } } } + if (produceType === 'raw') { + return (Array.isArray(raw) ? raw : [raw]).flat(); + } const files = (Array.isArray(raw) ? raw : [raw]).flat(); let filesContent = files .filter((i) => i != null && i !== '')