diff options
author | Alex <alexta69@gmail.com> | 2023-02-04 10:25:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-04 10:25:18 +0200 |
commit | 3e6c63646cd27b962fa875efcdebf62ef2141956 (patch) | |
tree | 97cf954e23f6a0cb03b2086522e55dc6d55ddf05 /ui/src | |
parent | upgraded yt-dlp (diff) | |
parent | unique downloads of identically named videos (diff) | |
download | metube-3e6c63646cd27b962fa875efcdebf62ef2141956.tar.gz metube-3e6c63646cd27b962fa875efcdebf62ef2141956.tar.bz2 metube-3e6c63646cd27b962fa875efcdebf62ef2141956.zip |
Merge pull request #216 from kaytwo/master
unique downloads of identically named videos
Diffstat (limited to 'ui/src')
-rw-r--r-- | ui/src/app/downloads.service.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/src/app/downloads.service.ts b/ui/src/app/downloads.service.ts index 77d2fed..e1a134d 100644 --- a/ui/src/app/downloads.service.ts +++ b/ui/src/app/downloads.service.ts @@ -52,20 +52,20 @@ export class DownloadsService { }); socket.fromEvent('added').subscribe((strdata: string) => { let data: Download = JSON.parse(strdata); - this.queue.set(data.id, data); + this.queue.set(data.url, data); this.queueChanged.next(null); }); socket.fromEvent('updated').subscribe((strdata: string) => { let data: Download = JSON.parse(strdata); - let dl: Download = this.queue.get(data.id); + let dl: Download = this.queue.get(data.url); data.checked = dl.checked; data.deleting = dl.deleting; - this.queue.set(data.id, data); + this.queue.set(data.url, data); }); socket.fromEvent('completed').subscribe((strdata: string) => { let data: Download = JSON.parse(strdata); - this.queue.delete(data.id); - this.done.set(data.id, data); + this.queue.delete(data.url); + this.done.set(data.url, data); this.queueChanged.next(null); this.doneChanged.next(null); }); @@ -110,7 +110,7 @@ export class DownloadsService { public delByFilter(where: string, filter: (dl: Download) => boolean) { let ids: string[] = []; - this[where].forEach((dl: Download) => { if (filter(dl)) ids.push(dl.id) }); + this[where].forEach((dl: Download) => { if (filter(dl)) ids.push(dl.url) }); return this.delById(where, ids); } } |