mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-12 04:29:00 +08:00
fix: Set default subscription source to remote when migrating data
This commit is contained in:
parent
ffd219abfe
commit
acd0a62496
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.7.0",
|
"version": "2.7.1",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -26,6 +26,9 @@ function doMigrationV2() {
|
|||||||
// 1. migrate subscriptions
|
// 1. migrate subscriptions
|
||||||
const subs = $.read(SUBS_KEY) || {};
|
const subs = $.read(SUBS_KEY) || {};
|
||||||
const newSubs = Object.values(subs).map((sub) => {
|
const newSubs = Object.values(subs).map((sub) => {
|
||||||
|
// set default source to remote
|
||||||
|
sub.source = sub.source || 'remote';
|
||||||
|
|
||||||
migrateDisplayName(sub);
|
migrateDisplayName(sub);
|
||||||
migrateProcesses(sub);
|
migrateProcesses(sub);
|
||||||
return sub;
|
return sub;
|
||||||
@ -54,7 +57,7 @@ function doMigrationV2() {
|
|||||||
|
|
||||||
// 5. delete builtin rules
|
// 5. delete builtin rules
|
||||||
delete $.cache.builtin;
|
delete $.cache.builtin;
|
||||||
$.info('Migration complete!');
|
$.info('Migration complete!');
|
||||||
|
|
||||||
function migrateDisplayName(item) {
|
function migrateDisplayName(item) {
|
||||||
const displayName = item['display-name'];
|
const displayName = item['display-name'];
|
||||||
@ -106,7 +109,7 @@ function doMigrationV2() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (p.type.indexOf('Keyword') !== -1) {
|
} else if (p.type.indexOf('Keyword') !== -1) {
|
||||||
// do nothing
|
// drop keyword operators and keyword filters
|
||||||
} else {
|
} else {
|
||||||
newProcesses.push(p);
|
newProcesses.push(p);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user