From 863d7e3728a618095501fb82a51fec238b53fd1b Mon Sep 17 00:00:00 2001 From: rdiaz738 Date: Tue, 25 Mar 2025 11:08:10 -0700 Subject: [PATCH] Update app.component.ts --- ui/src/app/app.component.ts | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts index 07f4c3e..c1d4e46 100644 --- a/ui/src/app/app.component.ts +++ b/ui/src/app/app.component.ts @@ -350,15 +350,22 @@ export class AppComponent implements AfterViewInit { } const url = urls[index]; this.batchImportStatus = `Importing URL ${index + 1} of ${urls.length}: ${url}`; - this.downloads.addDownloadByUrl(url) - .then(() => { - index++; - setTimeout(processNext, delayBetween); - }) - .catch(err => { - console.error(`Error importing URL ${url}:`, err); - index++; - setTimeout(processNext, delayBetween); + // Now pass the selected quality, format, folder, etc. to the add() method + this.downloads.add(url, this.quality, this.format, this.folder, this.customNamePrefix, + this.playlistStrictMode, this.playlistItemLimit, this.autoStart) + .subscribe({ + next: (status: Status) => { + if (status.status === 'error') { + alert(`Error adding URL ${url}: ${status.msg}`); + } + index++; + setTimeout(processNext, delayBetween); + }, + error: (err) => { + console.error(`Error importing URL ${url}:`, err); + index++; + setTimeout(processNext, delayBetween); + } }); }; processNext();