From 1f0ddf2d2846a547557572058deb24438dc1ebd6 Mon Sep 17 00:00:00 2001 From: xream Date: Sat, 12 Oct 2024 10:46:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BB=84=E5=90=88?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/restful/preview.js | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 9ee6e62..f5079f4 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.394", + "version": "2.14.395", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/restful/preview.js b/backend/src/restful/preview.js index a83020b..7fae34d 100644 --- a/backend/src/restful/preview.js +++ b/backend/src/restful/preview.js @@ -177,7 +177,20 @@ async function compareCollection(req, res) { try { const allSubs = $.read(SUBS_KEY); const collection = req.body; - const subnames = collection.subscriptions; + const subnames = [...collection.subscriptions]; + let subscriptionTags = collection.subscriptionTags; + if (Array.isArray(subscriptionTags) && subscriptionTags.length > 0) { + allSubs.forEach((sub) => { + if ( + Array.isArray(sub.tag) && + sub.tag.length > 0 && + !subnames.includes(sub.name) && + sub.tag.some((tag) => subscriptionTags.includes(tag)) + ) { + subnames.push(sub.name); + } + }); + } const results = {}; const errors = {}; await Promise.all(