We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
retrievelQueue
1 parent 188828e commit 6c0975dCopy full SHA for 6c0975d
src/index.js
@@ -3303,7 +3303,13 @@ async function retrieveBackgrounds() {
3303
async function retrieveMetadata() {
3304
3305
// find the first MAX_METADATA_REQUESTS items for which we haven't retrieved the metadata yet
3306
- const retrievalQueue = Array.from(playlist.children).filter(el => el.dataset.retrieve).slice(0, MAX_METADATA_REQUESTS);
+ const retrievalQueue = [];
3307
+ for (const el of playlist.children) {
3308
+ if (el.dataset.retrieve) {
3309
+ retrievalQueue.push(el);
3310
+ if (retrievalQueue.length >= MAX_METADATA_REQUESTS) break;
3311
+ }
3312
3313
3314
// Process in parallel
3315
return Promise.all(retrievalQueue.map(async queueItem => {
0 commit comments