mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-07 12:00:01 +03:00
Changes forEach loops in categorize() to regular for loops to facilitate early breaking
This commit is contained in:
@@ -45,8 +45,10 @@ async function categorize(file_jsons) {
|
||||
return null;
|
||||
}
|
||||
|
||||
file_jsons.forEach(file_json => {
|
||||
categories.forEach(category => {
|
||||
for (let i = 0; i < file_jsons.length; i++) {
|
||||
const file_json = file_jsons[i];
|
||||
for (let j = 0; j < categories.length; j++) {
|
||||
const category = categories[i];
|
||||
const rules = category['rules'];
|
||||
|
||||
// if rules for current category apply, then that is the selected category
|
||||
@@ -55,8 +57,8 @@ async function categorize(file_jsons) {
|
||||
logger.verbose(`Selected category ${category['name']} for ${file_json['webpage_url']}`);
|
||||
return selected_category;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return selected_category;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user