aboutsummaryrefslogtreecommitdiff
path: root/ui/src/app/downloads.service.ts
diff options
context:
space:
mode:
authorJames Woglom <j@wogloms.net>2022-08-30 00:55:16 -0400
committerJames Woglom <j@wogloms.net>2022-08-30 00:55:16 -0400
commitba712fc071398e615ead822c8bd81aad42a90c8f (patch)
tree7c2fba1317d0b2a34e88f46551e620f8cabac64c /ui/src/app/downloads.service.ts
parentalmost functional with selectize (diff)
downloadmetube-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.ts11
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);
});
}
bgstack15