From b2a797cd2562e2db0092cc69f7aafc6a376fc420 Mon Sep 17 00:00:00 2001 From: Peng-YM <1048217874pengym@gmail.com> Date: Tue, 5 Jul 2022 15:16:51 +0800 Subject: [PATCH] fix: Useless filters are not migrated --- backend/package.json | 2 +- backend/src/core/proxy-utils/processors/index.js | 5 +++++ backend/src/utils/migration.js | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 794ffd6..f7750a0 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.5.2", + "version": "2.5.3", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/processors/index.js b/backend/src/core/proxy-utils/processors/index.js index ee456ef..7463911 100644 --- a/backend/src/core/proxy-utils/processors/index.js +++ b/backend/src/core/proxy-utils/processors/index.js @@ -8,6 +8,11 @@ function QuickSettingOperator(args) { return { name: 'Quick Setting Operator', func: (proxies) => { + if (convert(args.useless)) { + const filter = UselessFilter(); + proxies = filter.func(proxies); + } + return proxies.map((proxy) => { proxy.udp = convert(args.udp); proxy.tfo = convert(args.tfo); diff --git a/backend/src/utils/migration.js b/backend/src/utils/migration.js index 84ff610..be7e869 100644 --- a/backend/src/utils/migration.js +++ b/backend/src/utils/migration.js @@ -75,10 +75,14 @@ function doMigrationV2() { tfo: 'DEFAULT', scert: 'DEFAULT', 'vmess aead': 'DEFAULT', + 'useless': 'DEFAULT', }, }; processes.forEach((p) => { - if (p.type === 'Set Property Operator') { + if (p.type === 'Useless Filter') { + quickSettingOperator.args.useless = 'ENABLED'; + } + else if (p.type === 'Set Property Operator') { const { key, value } = p.args; switch (key) { case 'udp':