Use for of loop

Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com>
This commit is contained in:
ChunkyProgrammer 2023-08-04 11:10:12 -04:00 committed by GitHub
parent de50a8fc6c
commit bbc06f32b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,15 +106,14 @@ export default {
// FreeTube DB // FreeTube DB
else if (text.indexOf("allChannels") != -1) { else if (text.indexOf("allChannels") != -1) {
const lines = text.split("\n"); const lines = text.split("\n");
for (let i = 0; i < lines.length; i++) { for (let line of lines) {
if (lines[i] !== "") { if (line === "") continue;
const json = JSON.parse(lines[i]); const json = JSON.parse(line);
json.subscriptions.forEach(item => { json.subscriptions.forEach(item => {
this.subscriptions.push(item.id); this.subscriptions.push(item.id);
}); });
} }
} }
}
// Google Takeout JSON // Google Takeout JSON
else if (text.indexOf("contentDetails") != -1) { else if (text.indexOf("contentDetails") != -1) {
const json = JSON.parse(text); const json = JSON.parse(text);