Add drumsReviewed filter

This commit is contained in:
Geomitron
2025-03-11 22:57:04 -05:00
parent 3881a69176
commit a70f968806
6 changed files with 47 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ export class SearchService {
public instrument: FormControl<Instrument | null>
public difficulty: FormControl<Difficulty | null>
public drumType: FormControl<DrumTypeName | null>
public drumsReviewed: FormControl<boolean>
public sortDirection: 'asc' | 'desc' = 'asc'
public sortColumn: 'name' | 'artist' | 'album' | 'genre' | 'year' | 'charter' | 'length' | 'modifiedTime' | null = null
@@ -69,6 +70,14 @@ export class SearchService {
}
})
this.drumsReviewed = new FormControl<boolean>((localStorage.getItem('drumsReviewed') ?? 'true') === 'true', { nonNullable: true })
this.drumsReviewed.valueChanges.subscribe(drumsReviewed => {
localStorage.setItem('drumsReviewed', `${drumsReviewed}`)
if (this.songsResponse?.page) {
this.search(this.searchControl.value || '*').subscribe()
}
})
this.http.get<{ "name": string; "sha1": string }[]>('https://clonehero.gitlab.io/sources/icons.json').subscribe(result => {
this.availableIcons = result.map(r => r.name)
})
@@ -104,6 +113,7 @@ export class SearchService {
instrument: this.instrument.value,
difficulty: this.difficulty.value,
drumType: this.drumType.value,
drumsReviewed: this.drumsReviewed.value,
sort: this.sortColumn !== null ? { type: this.sortColumn, direction: this.sortDirection } : null,
source: 'bridge',
}).pipe(