mirror of
https://github.com/alexta69/metube.git
synced 2025-04-02 20:07:36 +03:00
Update app.component.ts
This commit is contained in:
parent
8ea3359730
commit
863d7e3728
1 changed files with 16 additions and 9 deletions
|
@ -350,15 +350,22 @@ export class AppComponent implements AfterViewInit {
|
||||||
}
|
}
|
||||||
const url = urls[index];
|
const url = urls[index];
|
||||||
this.batchImportStatus = `Importing URL ${index + 1} of ${urls.length}: ${url}`;
|
this.batchImportStatus = `Importing URL ${index + 1} of ${urls.length}: ${url}`;
|
||||||
this.downloads.addDownloadByUrl(url)
|
// Now pass the selected quality, format, folder, etc. to the add() method
|
||||||
.then(() => {
|
this.downloads.add(url, this.quality, this.format, this.folder, this.customNamePrefix,
|
||||||
index++;
|
this.playlistStrictMode, this.playlistItemLimit, this.autoStart)
|
||||||
setTimeout(processNext, delayBetween);
|
.subscribe({
|
||||||
})
|
next: (status: Status) => {
|
||||||
.catch(err => {
|
if (status.status === 'error') {
|
||||||
console.error(`Error importing URL ${url}:`, err);
|
alert(`Error adding URL ${url}: ${status.msg}`);
|
||||||
index++;
|
}
|
||||||
setTimeout(processNext, delayBetween);
|
index++;
|
||||||
|
setTimeout(processNext, delayBetween);
|
||||||
|
},
|
||||||
|
error: (err) => {
|
||||||
|
console.error(`Error importing URL ${url}:`, err);
|
||||||
|
index++;
|
||||||
|
setTimeout(processNext, delayBetween);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
processNext();
|
processNext();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue