Fix: FreeTube Subscription Import (#2744)

* Fix: FreeTube Subscription Import

* Use for of loop

Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com>

---------

Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com>
This commit is contained in:
ChunkyProgrammer 2023-08-04 08:35:02 -07:00 committed by GitHub
parent 6978f52246
commit a9305f26c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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