diff --git a/bilibili-evolved.offline.user.js b/bilibili-evolved.offline.user.js index 87f235202..61a679f42 100644 --- a/bilibili-evolved.offline.user.js +++ b/bilibili-evolved.offline.user.js @@ -1950,11 +1950,15 @@ class ResourceManager })); } } - await Promise.all(Object.values(Resource.manifest) - .concat(Object.values(Resource.all)) - .filter(it => it.dropdown) - .map(it => applyDropdownOption(it.dropdown)) - ); + const manifests = Object.values(Resource.manifest).filter(it => it.dropdown).map(it => it.dropdown); + Object.values(Resource.all).filter(it => it.dropdown).map(it => it.dropdown).forEach(it => + { + if (!manifests.some(m => m.key === it.key)) + { + manifests.push(it); + } + }); + await Promise.all(manifests.map(it => applyDropdownOption(it))); } validateCache() { diff --git a/bilibili-evolved.preview-offline.user.js b/bilibili-evolved.preview-offline.user.js index 5372368c4..a52413d6e 100644 --- a/bilibili-evolved.preview-offline.user.js +++ b/bilibili-evolved.preview-offline.user.js @@ -1950,11 +1950,15 @@ class ResourceManager })); } } - await Promise.all(Object.values(Resource.manifest) - .concat(Object.values(Resource.all)) - .filter(it => it.dropdown) - .map(it => applyDropdownOption(it.dropdown)) - ); + const manifests = Object.values(Resource.manifest).filter(it => it.dropdown).map(it => it.dropdown); + Object.values(Resource.all).filter(it => it.dropdown).map(it => it.dropdown).forEach(it => + { + if (!manifests.some(m => m.key === it.key)) + { + manifests.push(it); + } + }); + await Promise.all(manifests.map(it => applyDropdownOption(it))); } validateCache() { diff --git a/bilibili-evolved.preview.user.js b/bilibili-evolved.preview.user.js index e8b08ded5..27b71bff4 100644 --- a/bilibili-evolved.preview.user.js +++ b/bilibili-evolved.preview.user.js @@ -1895,11 +1895,15 @@ class ResourceManager })); } } - await Promise.all(Object.values(Resource.manifest) - .concat(Object.values(Resource.all)) - .filter(it => it.dropdown) - .map(it => applyDropdownOption(it.dropdown)) - ); + const manifests = Object.values(Resource.manifest).filter(it => it.dropdown).map(it => it.dropdown); + Object.values(Resource.all).filter(it => it.dropdown).map(it => it.dropdown).forEach(it => + { + if (!manifests.some(m => m.key === it.key)) + { + manifests.push(it); + } + }); + await Promise.all(manifests.map(it => applyDropdownOption(it))); } validateCache() { diff --git a/bilibili-evolved.user.js b/bilibili-evolved.user.js index b9e198f35..cfaddf8a2 100644 --- a/bilibili-evolved.user.js +++ b/bilibili-evolved.user.js @@ -1895,11 +1895,15 @@ class ResourceManager })); } } - await Promise.all(Object.values(Resource.manifest) - .concat(Object.values(Resource.all)) - .filter(it => it.dropdown) - .map(it => applyDropdownOption(it.dropdown)) - ); + const manifests = Object.values(Resource.manifest).filter(it => it.dropdown).map(it => it.dropdown); + Object.values(Resource.all).filter(it => it.dropdown).map(it => it.dropdown).forEach(it => + { + if (!manifests.some(m => m.key === it.key)) + { + manifests.push(it); + } + }); + await Promise.all(manifests.map(it => applyDropdownOption(it))); } validateCache() { diff --git a/client/resource-manager.js b/client/resource-manager.js index 882423dcf..48ab81b66 100644 --- a/client/resource-manager.js +++ b/client/resource-manager.js @@ -249,11 +249,15 @@ export class ResourceManager })); } } - await Promise.all(Object.values(Resource.manifest) - .concat(Object.values(Resource.all)) - .filter(it => it.dropdown) - .map(it => applyDropdownOption(it.dropdown)) - ); + const manifests = Object.values(Resource.manifest).filter(it => it.dropdown).map(it => it.dropdown); + Object.values(Resource.all).filter(it => it.dropdown).map(it => it.dropdown).forEach(it => + { + if (!manifests.some(m => m.key === it.key)) + { + manifests.push(it); + } + }); + await Promise.all(manifests.map(it => applyDropdownOption(it))); } validateCache() {