diff options
author | James Woglom <j@wogloms.net> | 2022-08-30 00:55:16 -0400 |
---|---|---|
committer | James Woglom <j@wogloms.net> | 2022-08-30 00:55:16 -0400 |
commit | ba712fc071398e615ead822c8bd81aad42a90c8f (patch) | |
tree | 7c2fba1317d0b2a34e88f46551e620f8cabac64c /ui/src/app/downloads.service.ts | |
parent | almost functional with selectize (diff) | |
download | metube-ba712fc071398e615ead822c8bd81aad42a90c8f.tar.gz metube-ba712fc071398e615ead822c8bd81aad42a90c8f.tar.bz2 metube-ba712fc071398e615ead822c8bd81aad42a90c8f.zip |
Fill in download_dir or audio_download_dir on launch
Diffstat (limited to 'ui/src/app/downloads.service.ts')
-rw-r--r-- | ui/src/app/downloads.service.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ui/src/app/downloads.service.ts b/ui/src/app/downloads.service.ts index 42ffe6d..1fd75e3 100644 --- a/ui/src/app/downloads.service.ts +++ b/ui/src/app/downloads.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; -import { of, Subject } from 'rxjs'; +import { Observable, of, Subject } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { MeTubeSocket } from './metube-socket'; @@ -33,7 +33,7 @@ export class DownloadsService { done = new Map<string, Download>(); queueChanged = new Subject(); doneChanged = new Subject(); - customDirsChanged = new Subject<string[]>(); + customDirs = new Subject<Map<string, string[]>>(); configuration = {}; constructor(private http: HttpClient, private socket: MeTubeSocket) { @@ -81,11 +81,10 @@ export class DownloadsService { console.debug("got configuration:", data); this.configuration = data; }); - socket.fromEvent('custom_directories').subscribe((strdata: string) => { + socket.fromEvent('custom_dirs').subscribe((strdata: string) => { let data = JSON.parse(strdata); - console.debug("got custom_directories:", data); - let customDirectories = data["directories"]; - this.customDirsChanged.next(customDirectories); + console.debug("got custom_dirs:", data); + this.customDirs.next(data); }); } |