mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 22:29:38 +00:00
Improve search result sorting
This commit is contained in:
@@ -33,6 +33,8 @@ export class SearchService {
|
||||
public instrument: FormControl<Instrument | null>
|
||||
public difficulty: FormControl<Difficulty | null>
|
||||
public drumType: FormControl<DrumTypeName | null>
|
||||
public sortDirection: 'asc' | 'desc' = 'asc'
|
||||
public sortColumn: 'name' | 'artist' | 'album' | 'genre' | 'year' | 'charter' | 'length' | null = null
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
@@ -102,6 +104,7 @@ export class SearchService {
|
||||
instrument: this.instrument.value,
|
||||
difficulty: this.difficulty.value,
|
||||
drumType: this.drumType.value,
|
||||
sort: this.sortColumn !== null ? { type: this.sortColumn, direction: this.sortDirection } : null,
|
||||
source: 'bridge',
|
||||
}).pipe(
|
||||
catchError((err, caught) => {
|
||||
@@ -212,4 +215,12 @@ export class SearchService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public reloadSearch() {
|
||||
if (this.isAdvancedSearch) {
|
||||
this.advancedSearch(this.lastAdvancedSearch, false).subscribe()
|
||||
} else {
|
||||
this.search(this.searchControl.value || '*', false).subscribe()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user