diff --git a/src-angular/app/components/browse/search-bar/search-bar.component.html b/src-angular/app/components/browse/search-bar/search-bar.component.html
index e43dd03..9f469f9 100644
--- a/src-angular/app/components/browse/search-bar/search-bar.component.html
+++ b/src-angular/app/components/browse/search-bar/search-bar.component.html
@@ -55,7 +55,7 @@
@if (instrument === 'drums') {
-
+
+
+
+
+
+
}
diff --git a/src-angular/app/components/browse/search-bar/search-bar.component.ts b/src-angular/app/components/browse/search-bar/search-bar.component.ts
index 7779ea9..ab62531 100644
--- a/src-angular/app/components/browse/search-bar/search-bar.component.ts
+++ b/src-angular/app/components/browse/search-bar/search-bar.component.ts
@@ -5,7 +5,7 @@ import dayjs from 'dayjs'
import { distinctUntilChanged, switchMap, throttleTime } from 'rxjs'
import { Difficulty, Instrument } from 'scan-chart'
import { SearchService } from 'src-angular/app/core/services/search.service'
-import { difficulties, difficultyDisplay, drumTypeDisplay, DrumTypeName, drumTypeNames, instrumentDisplay, instruments } from 'src-shared/UtilFunctions'
+import { difficulties, difficultyDisplay, drumsReviewedDisplay, drumTypeDisplay, DrumTypeName, drumTypeNames, instrumentDisplay, instruments } from 'src-shared/UtilFunctions'
@Component({
selector: 'app-search-bar',
@@ -30,6 +30,7 @@ export class SearchBarComponent implements OnInit, AfterViewInit {
public instrumentDisplay = instrumentDisplay
public difficultyDisplay = difficultyDisplay
public drumTypeDisplay = drumTypeDisplay
+ public drumsReviewedDisplay = drumsReviewedDisplay
public advancedSearchForm: ReturnType
public startValidation = false
@@ -103,6 +104,16 @@ export class SearchBarComponent implements OnInit, AfterViewInit {
}
}
+ get drumsReviewed() {
+ return this.searchService.drumsReviewed.value
+ }
+ setDrumsReviewed(drumsReviewed: boolean, event: MouseEvent) {
+ this.searchService.drumsReviewed.setValue(drumsReviewed)
+ if (event.target instanceof HTMLElement) {
+ event.target.parentElement?.parentElement?.blur()
+ }
+ }
+
get todayDate() {
return dayjs().format('YYYY-MM-DD')
}
@@ -225,6 +236,7 @@ export class SearchBarComponent implements OnInit, AfterViewInit {
instrument: this.instrument,
difficulty: this.difficulty,
drumType: this.drumType,
+ drumsReviewed: this.drumsReviewed,
sort: this.searchService.sortColumn !== null ? { type: this.searchService.sortColumn, direction: this.searchService.sortDirection } : null,
source: 'bridge' as const,
...this.advancedSearchForm.getRawValue(),
diff --git a/src-angular/app/core/services/search.service.ts b/src-angular/app/core/services/search.service.ts
index e8086b1..426d30f 100644
--- a/src-angular/app/core/services/search.service.ts
+++ b/src-angular/app/core/services/search.service.ts
@@ -33,6 +33,7 @@ export class SearchService {
public instrument: FormControl
public difficulty: FormControl
public drumType: FormControl
+ public drumsReviewed: FormControl
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((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(
diff --git a/src-shared/UtilFunctions.ts b/src-shared/UtilFunctions.ts
index 6f2958e..cbd1be3 100644
--- a/src-shared/UtilFunctions.ts
+++ b/src-shared/UtilFunctions.ts
@@ -111,6 +111,13 @@ export function drumTypeDisplay(drumType: DrumTypeName | null) {
case null: return 'Any Drum Type'
}
}
+export function drumsReviewedDisplay(drumsReviewed: boolean) {
+ if (drumsReviewed) {
+ return 'Quality Reviewed'
+ } else {
+ return 'Any Quality'
+ }
+}
export function instrumentToDiff(instrument: Instrument | 'vocals') {
switch (instrument) {
case 'guitar': return 'diff_guitar'
diff --git a/src-shared/interfaces/search.interface.ts b/src-shared/interfaces/search.interface.ts
index 00562b1..f35e1b7 100644
--- a/src-shared/interfaces/search.interface.ts
+++ b/src-shared/interfaces/search.interface.ts
@@ -12,6 +12,7 @@ export const GeneralSearchSchema = z.object({
instrument: z.enum(instruments).nullable(),
difficulty: z.enum(difficulties).nullable(),
drumType: z.enum(drumTypeNames).nullable(),
+ drumsReviewed: z.boolean().optional().default(true),
sort: z
.object({ type: z.enum(searchSortProperties), direction: z.enum(['asc', 'desc']) })
.nullable()
@@ -32,6 +33,7 @@ export const AdvancedSearchSchema = z.object({
}, { message: 'Invalid instrument list' }).nullable(),
difficulty: z.enum(difficulties).nullable(),
drumType: z.enum(drumTypeNames).nullable(),
+ drumsReviewed: z.boolean().optional().default(true),
sort: z
.object({ type: z.enum(searchSortProperties), direction: z.enum(['asc', 'desc']) })
.nullable()
diff --git a/src-shared/search-api.ts b/src-shared/search-api.ts
index 433ca1e..241c60e 100644
--- a/src-shared/search-api.ts
+++ b/src-shared/search-api.ts
@@ -12,6 +12,7 @@ export const GeneralSearchSchema = z.object({
instrument: z.enum(instruments).nullable().default(null),
difficulty: z.enum(difficulties).nullable().default(null),
drumType: z.enum(drumTypeNames).nullable().default(null),
+ drumsReviewed: z.boolean().optional().default(true),
sort: z
.object({ type: z.enum(searchSortProperties), direction: z.enum(['asc', 'desc']) })
.nullable()
@@ -27,6 +28,7 @@ export const AdvancedSearchSchema = z.object({
instrument: z.enum(instruments).nullable().default(null),
difficulty: z.enum(difficulties).nullable().default(null),
drumType: z.enum(drumTypeNames).nullable().default(null),
+ drumsReviewed: z.boolean().optional().default(true),
sort: z
.object({ type: z.enum(searchSortProperties), direction: z.enum(['asc', 'desc']) })
.nullable()