mirror of
https://github.com/alexta69/metube.git
synced 2026-06-13 16:40:05 +00:00
review fixes
This commit is contained in:
+18
-7
@@ -384,7 +384,6 @@
|
|||||||
(click)="folderClick$.next($any($event.target).value)"
|
(click)="folderClick$.next($any($event.target).value)"
|
||||||
#folderTypeahead="ngbTypeahead"
|
#folderTypeahead="ngbTypeahead"
|
||||||
[disabled]="addInProgress || subscribeInProgress || downloads.loading">
|
[disabled]="addInProgress || subscribeInProgress || downloads.loading">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -450,12 +449,17 @@
|
|||||||
<!-- Behavior -->
|
<!-- Behavior -->
|
||||||
<div class="settings-section-label">Behavior</div>
|
<div class="settings-section-label">Behavior</div>
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
<div class="col-md-6 d-flex align-items-center">
|
<div class="col-md-6">
|
||||||
<div class="form-check form-switch">
|
<div class="input-group">
|
||||||
<input class="form-check-input" type="checkbox" role="switch" id="checkbox-auto-start"
|
<span class="input-group-text help-title" ngbPopover="Automatically start downloads when added." triggers="click" autoClose="outside" container="body">Auto Start</span>
|
||||||
name="autoStart" [(ngModel)]="autoStart" (change)="autoStartChanged()"
|
<select class="form-select"
|
||||||
|
name="autoStart"
|
||||||
|
[(ngModel)]="autoStart"
|
||||||
|
(change)="autoStartChanged()"
|
||||||
[disabled]="addInProgress || subscribeInProgress || downloads.loading">
|
[disabled]="addInProgress || subscribeInProgress || downloads.loading">
|
||||||
<label class="form-check-label help-title" for="checkbox-auto-start" ngbPopover="Automatically start downloads when added." triggers="click" autoClose="outside" container="body" (click)="$event.preventDefault()">Auto Start</label>
|
<option [ngValue]="true">Yes</option>
|
||||||
|
<option [ngValue]="false">No</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -500,7 +504,14 @@
|
|||||||
<input class="form-check-input" type="checkbox" role="switch" id="checkbox-skip-subscriber-only"
|
<input class="form-check-input" type="checkbox" role="switch" id="checkbox-skip-subscriber-only"
|
||||||
name="skipSubscriberOnly" [(ngModel)]="skipSubscriberOnly"
|
name="skipSubscriberOnly" [(ngModel)]="skipSubscriberOnly"
|
||||||
[disabled]="addInProgress || subscribeInProgress || downloads.loading" />
|
[disabled]="addInProgress || subscribeInProgress || downloads.loading" />
|
||||||
<label class="form-check-label help-title" for="checkbox-skip-subscriber-only" ngbPopover="When enabled, subscription checks skip videos marked members-only by yt-dlp (channel Join). Ignored for one-off downloads." triggers="click" autoClose="outside" container="body" (click)="$event.preventDefault()">Skip members-only subscription videos</label>
|
<label class="form-check-label" for="checkbox-skip-subscriber-only">
|
||||||
|
<span class="help-title" tabindex="0" role="button"
|
||||||
|
ngbPopover="When enabled, subscription checks skip videos marked members-only by yt-dlp (channel Join). Ignored for one-off downloads."
|
||||||
|
triggers="click" autoClose="outside" container="body"
|
||||||
|
(click)="$event.preventDefault(); $event.stopPropagation()"
|
||||||
|
(keydown.enter)="$event.preventDefault(); $event.stopPropagation()"
|
||||||
|
(keydown.space)="$event.preventDefault(); $event.stopPropagation()">Skip members-only subscription videos</span>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ export class App implements AfterViewInit, OnInit, OnDestroy {
|
|||||||
cookieUploadInProgress = false;
|
cookieUploadInProgress = false;
|
||||||
themes: Theme[] = Themes;
|
themes: Theme[] = Themes;
|
||||||
activeTheme: Theme | undefined;
|
activeTheme: Theme | undefined;
|
||||||
customDirs$!: Observable<string[]>;
|
|
||||||
readonly folderTypeahead = viewChild<NgbTypeahead>('folderTypeahead');
|
readonly folderTypeahead = viewChild<NgbTypeahead>('folderTypeahead');
|
||||||
folderFocus$ = new Subject<string>();
|
folderFocus$ = new Subject<string>();
|
||||||
folderClick$ = new Subject<string>();
|
folderClick$ = new Subject<string>();
|
||||||
@@ -310,7 +309,6 @@ export class App implements AfterViewInit, OnInit, OnDestroy {
|
|||||||
this.getConfiguration();
|
this.getConfiguration();
|
||||||
this.getYtdlOptionsUpdateTime();
|
this.getYtdlOptionsUpdateTime();
|
||||||
this.getYtdlOptionPresets();
|
this.getYtdlOptionPresets();
|
||||||
this.customDirs$ = this.getMatchingCustomDir();
|
|
||||||
this.setTheme(this.activeTheme!);
|
this.setTheme(this.activeTheme!);
|
||||||
|
|
||||||
this.colorSchemeMediaQuery.addEventListener('change', this.onColorSchemeChanged);
|
this.colorSchemeMediaQuery.addEventListener('change', this.onColorSchemeChanged);
|
||||||
@@ -377,13 +375,6 @@ export class App implements AfterViewInit, OnInit, OnDestroy {
|
|||||||
return this.downloads.configuration['ALLOW_YTDL_OPTIONS_OVERRIDES'] === true;
|
return this.downloads.configuration['ALLOW_YTDL_OPTIONS_OVERRIDES'] === true;
|
||||||
}
|
}
|
||||||
|
|
||||||
allowCustomDir(tag: string) {
|
|
||||||
if (this.downloads.configuration['CREATE_CUSTOM_DIRS']) {
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
searchFolder: OperatorFunction<string, readonly string[]> = (text$: Observable<string>) => {
|
searchFolder: OperatorFunction<string, readonly string[]> = (text$: Observable<string>) => {
|
||||||
const debouncedText$ = text$.pipe(debounceTime(150), distinctUntilChanged());
|
const debouncedText$ = text$.pipe(debounceTime(150), distinctUntilChanged());
|
||||||
const clicksWithClosedPopup$ = this.folderClick$.pipe(
|
const clicksWithClosedPopup$ = this.folderClick$.pipe(
|
||||||
@@ -404,23 +395,6 @@ export class App implements AfterViewInit, OnInit, OnDestroy {
|
|||||||
return this.downloadType === 'audio';
|
return this.downloadType === 'audio';
|
||||||
}
|
}
|
||||||
|
|
||||||
getMatchingCustomDir() : Observable<string[]> {
|
|
||||||
return this.downloads.customDirsChanged.asObservable().pipe(
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
map((output: any) => {
|
|
||||||
// Keep logic consistent with app/ytdl.py
|
|
||||||
if (this.isAudioType()) {
|
|
||||||
console.debug("Showing audio-specific download directories");
|
|
||||||
return output["audio_download_dir"];
|
|
||||||
} else {
|
|
||||||
console.debug("Showing default download directories");
|
|
||||||
return output["download_dir"];
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
distinctUntilChanged((prev, curr) => JSON.stringify(prev) === JSON.stringify(curr))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
getYtdlOptionsUpdateTime() {
|
getYtdlOptionsUpdateTime() {
|
||||||
this.downloads.ytdlOptionsChanged.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
|
this.downloads.ytdlOptionsChanged.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
|||||||
Reference in New Issue
Block a user