switch between audio and default custom directories on change

This commit is contained in:
James Woglom
2022-08-30 00:58:19 -04:00
parent ba712fc071
commit 52e3307d99
2 changed files with 12 additions and 5 deletions

View File

@@ -33,8 +33,10 @@ export class DownloadsService {
done = new Map<string, Download>();
queueChanged = new Subject();
doneChanged = new Subject();
customDirs = new Subject<Map<string, string[]>>();
customDirsChanged = new Subject();
configuration = {};
customDirs = {};
constructor(private http: HttpClient, private socket: MeTubeSocket) {
socket.fromEvent('all').subscribe((strdata: string) => {
@@ -84,7 +86,8 @@ export class DownloadsService {
socket.fromEvent('custom_dirs').subscribe((strdata: string) => {
let data = JSON.parse(strdata);
console.debug("got custom_dirs:", data);
this.customDirs.next(data);
this.customDirs = data;
this.customDirsChanged.next(data);
});
}