aboutsummaryrefslogtreecommitdiff
path: root/ui/src/app/app.component.ts
diff options
context:
space:
mode:
authorJames Woglom <j@wogloms.net>2022-08-30 00:58:19 -0400
committerJames Woglom <j@wogloms.net>2022-08-30 00:58:19 -0400
commit52e3307d99b6f809c6a7a281b2a33bbc67c0e006 (patch)
treed44c7758ed9422bc4cdea97783e2fa12fca563e7 /ui/src/app/app.component.ts
parentFill in download_dir or audio_download_dir on launch (diff)
downloadmetube-52e3307d99b6f809c6a7a281b2a33bbc67c0e006.tar.gz
metube-52e3307d99b6f809c6a7a281b2a33bbc67c0e006.tar.bz2
metube-52e3307d99b6f809c6a7a281b2a33bbc67c0e006.zip
switch between audio and default custom directories on change
Diffstat (limited to 'ui/src/app/app.component.ts')
-rw-r--r--ui/src/app/app.component.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts
index e716395..cdcd8f6 100644
--- a/ui/src/app/app.component.ts
+++ b/ui/src/app/app.component.ts
@@ -77,6 +77,8 @@ export class AppComponent implements AfterViewInit {
qualityChanged() {
this.cookieService.set('metube_quality', this.quality, { expires: 3650 });
+ // Re-trigger custom directory change
+ this.downloads.customDirsChanged.next(this.downloads.customDirs);
}
showAdvanced() {
@@ -88,13 +90,13 @@ export class AppComponent implements AfterViewInit {
}
getMatchingCustomDir() : Observable<string[]> {
- return this.downloads.customDirs.asObservable().pipe(map((output) => {
+ return this.downloads.customDirsChanged.asObservable().pipe(map((output) => {
// Keep logic consistent with app/ytdl.py
if (this.quality != 'audio' && this.format != 'mp3') {
- console.debug("download_dir", output["download_dir"])
+ console.debug("Showing default download directories");
return output["download_dir"];
} else {
- console.debug("audio_download_dir", output["audio_download_dir"])
+ console.debug("Showing audio-specific download directories");
return output["audio_download_dir"];
}
}));
@@ -125,6 +127,8 @@ export class AppComponent implements AfterViewInit {
this.cookieService.set('metube_format', this.format, { expires: 3650 });
// Updates to use qualities available
this.setQualities()
+ // Re-trigger custom directory change
+ this.downloads.customDirsChanged.next(this.downloads.customDirs);
}
queueSelectionChanged(checked: number) {
bgstack15