Skip to content

Commit

Permalink
feat: 组合订阅支持通过单条订阅的标签进行关联
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Oct 11, 2024
1 parent 71d9adb commit b3adbff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.392",
"version": "2.14.393",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
17 changes: 16 additions & 1 deletion backend/src/restful/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,22 @@ async function produceArtifact({
const allCols = $.read(COLLECTIONS_KEY);
const collection = findByName(allCols, name);
if (!collection) throw new Error(`找不到组合订阅 ${name}`);
const subnames = collection.subscriptions;
let subnames = collection.subscriptions;
if (!Array.isArray(subnames)) subnames = [];
let subscriptionTags = collection.subscriptionTags;
if (!Array.isArray(subscriptionTags)) subscriptionTags = [];
if (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 = {};
let processed = 0;
Expand Down

0 comments on commit b3adbff

Please sign in to comment.