diff --git a/backend/package.json b/backend/package.json index 9ee6e62c8..f5079f4ce 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 a83020b42..7fae34dba 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(