mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-12 01:39:02 +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 collection = item;
|
||||
const subs = collection['subscriptions'];
|
||||
let proxies = [];
|
||||
|
||||
const results = {};
|
||||
let processed = 0;
|
||||
|
||||
await Promise.all(
|
||||
@ -296,8 +295,7 @@ async function produceArtifact(
|
||||
// apply processors
|
||||
currentProxies = await ProxyUtils.process(currentProxies, sub.process || [], platform);
|
||||
}
|
||||
// merge
|
||||
proxies = proxies.concat(currentProxies);
|
||||
results[name] = currentProxies;
|
||||
processed++;
|
||||
$.info(`✅ 子订阅:${sub.name}加载成功,进度--${100 * (processed / subs.length).toFixed(1)}% `);
|
||||
} 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) {
|
||||
// apply own processors
|
||||
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