Add a download selected button for non-autostarted downloads

This commit is contained in:
lvank
2025-01-12 20:15:23 -06:00
parent d0a2de2acd
commit 1c02883f0e
3 changed files with 13 additions and 0 deletions

View File

@@ -118,6 +118,12 @@ export class DownloadsService {
return this.http.post('delete', {where: where, ids: ids});
}
public startByFilter(where: string, filter: (dl: Download) => boolean) {
let ids: string[] = [];
this[where].forEach((dl: Download) => { if (filter(dl)) ids.push(dl.url) });
return this.startById(ids);
}
public delByFilter(where: string, filter: (dl: Download) => boolean) {
let ids: string[] = [];
this[where].forEach((dl: Download) => { if (filter(dl)) ids.push(dl.url) });