mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-12 08:09:08 +08:00
Fixed collection ordering is not preserved
This commit is contained in:
parent
bd58aaa2a4
commit
47451c2df7
@ -280,8 +280,7 @@ async function produceArtifact(
|
|||||||
const allSubs = $.read(SUBS_KEY);
|
const allSubs = $.read(SUBS_KEY);
|
||||||
const collection = item;
|
const collection = item;
|
||||||
const subs = collection['subscriptions'];
|
const subs = collection['subscriptions'];
|
||||||
let proxies = [];
|
const results = {};
|
||||||
|
|
||||||
let processed = 0;
|
let processed = 0;
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
@ -296,8 +295,7 @@ async function produceArtifact(
|
|||||||
// apply processors
|
// apply processors
|
||||||
currentProxies = await ProxyUtils.process(currentProxies, sub.process || [], platform);
|
currentProxies = await ProxyUtils.process(currentProxies, sub.process || [], platform);
|
||||||
}
|
}
|
||||||
// merge
|
results[name] = currentProxies;
|
||||||
proxies = proxies.concat(currentProxies);
|
|
||||||
processed++;
|
processed++;
|
||||||
$.info(`✅ 子订阅:${sub.name}加载成功,进度--${100 * (processed / subs.length).toFixed(1)}% `);
|
$.info(`✅ 子订阅:${sub.name}加载成功,进度--${100 * (processed / subs.length).toFixed(1)}% `);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@ -309,6 +307,10 @@ async function produceArtifact(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// merge proxies with the original order
|
||||||
|
let proxies = Array.prototype.concat.apply([], subs.map(name => results[name]));
|
||||||
|
|
||||||
if (!noProcessor) {
|
if (!noProcessor) {
|
||||||
// apply own processors
|
// apply own processors
|
||||||
proxies = await ProxyUtils.process(proxies, collection.process || [], platform);
|
proxies = await ProxyUtils.process(proxies, collection.process || [], platform);
|
||||||
|
2
backend/sub-store.min.js
vendored
2
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user