[ Feature ] Add retry button (#327)
This commit is contained in:
@@ -35,6 +35,8 @@ export class AppComponent implements AfterViewInit {
|
||||
@ViewChild('doneDelSelected') doneDelSelected: ElementRef;
|
||||
@ViewChild('doneClearCompleted') doneClearCompleted: ElementRef;
|
||||
@ViewChild('doneClearFailed') doneClearFailed: ElementRef;
|
||||
@ViewChild('doneRetryFailed') doneRetryFailed: ElementRef;
|
||||
|
||||
|
||||
faTrashAlt = faTrashAlt;
|
||||
faCheckCircle = faCheckCircle;
|
||||
@@ -83,6 +85,7 @@ export class AppComponent implements AfterViewInit {
|
||||
});
|
||||
this.doneClearCompleted.nativeElement.disabled = completed === 0;
|
||||
this.doneClearFailed.nativeElement.disabled = failed === 0;
|
||||
this.doneRetryFailed.nativeElement.disabled = failed === 0;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -221,6 +224,14 @@ export class AppComponent implements AfterViewInit {
|
||||
this.downloads.delByFilter('done', dl => dl.status === 'error').subscribe();
|
||||
}
|
||||
|
||||
retryFailedDownloads() {
|
||||
this.downloads.done.forEach((dl, key) => {
|
||||
if (dl.status === 'error') {
|
||||
this.retryDownload(key, dl);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
buildDownloadLink(download: Download) {
|
||||
let baseDir = 'download/';
|
||||
if (download.quality == 'audio' || download.filename.endsWith('.mp3')) {
|
||||
|
||||
Reference in New Issue
Block a user