fix(history): recherche et filtres fonctionnels sur les 3 onglets
CI / build-and-test (push) Successful in 14m0s
CI / build-and-test (push) Successful in 14m0s
- distinctUntilChanged() sur Subject<void> avalait toutes les frappes apres la premiere : barre de recherche morte sur les 3 onglets. - Filtre provider recherches : ids courts stockes (yt, dm) vs filtre long (youtube) -> zero resultat. Match court+long cote serveur. - LIKE echappes (%, _, \\) sur q des 3 onglets. - Watch/transcripts : provider normalise (court+long), lang insensible a la casse avec prefixe (fr -> fr, fr-ca). - Ecriture watch canonique (nom long). Test test:history.
This commit is contained in:
@@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, inject, signal, computed } from '@a
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterModule, ActivatedRoute } from '@angular/router';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
import {
|
||||
HistoryService, SearchHistoryItem, WatchHistoryItem, TranscriptHistoryItem,
|
||||
@@ -80,8 +80,11 @@ export class HistoryComponent {
|
||||
const tab = this.route.snapshot.queryParamMap.get('tab');
|
||||
if (tab === 'watch' || tab === 'transcripts' || tab === 'search') this.activeTab.set(tab);
|
||||
} catch {}
|
||||
// Recherche debouncée -> recharge serveur avec q/provider/lang
|
||||
this.searchTerms.pipe(debounceTime(300), distinctUntilChanged()).subscribe(() => this.reloadActive(true));
|
||||
// Recherche debouncée -> recharge serveur avec q/provider/lang.
|
||||
// NOTE : pas de distinctUntilChanged() ici : searchTerms est un
|
||||
// Subject<void> (émissions `undefined`), et distinctUntilChanged
|
||||
// aurait avalé toutes les frappes après la première.
|
||||
this.searchTerms.pipe(debounceTime(300)).subscribe(() => this.reloadActive(true));
|
||||
this.reloadAll();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user