clean up controllers
This commit is contained in:
@@ -84,9 +84,9 @@ func writeResp(w http.ResponseWriter, r *http.Request, resp *spec.Response) erro
|
||||
return ew.err
|
||||
}
|
||||
|
||||
type subsonicHandler func(r *http.Request) *spec.Response
|
||||
type handlerSubsonic func(r *http.Request) *spec.Response
|
||||
|
||||
func (c *Controller) H(h subsonicHandler) http.Handler {
|
||||
func (c *Controller) H(h handlerSubsonic) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
response := h(r)
|
||||
if response == nil {
|
||||
@@ -99,9 +99,9 @@ func (c *Controller) H(h subsonicHandler) http.Handler {
|
||||
})
|
||||
}
|
||||
|
||||
type subsonicHandlerRaw func(w http.ResponseWriter, r *http.Request) *spec.Response
|
||||
type handlerSubsonicRaw func(w http.ResponseWriter, r *http.Request) *spec.Response
|
||||
|
||||
func (c *Controller) HR(h subsonicHandlerRaw) http.Handler {
|
||||
func (c *Controller) HR(h handlerSubsonicRaw) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
response := h(w, r)
|
||||
if response == nil {
|
||||
|
||||
@@ -39,7 +39,7 @@ type queryCase struct {
|
||||
listSet bool
|
||||
}
|
||||
|
||||
func runQueryCases(t *testing.T, h subsonicHandler, cases []*queryCase) {
|
||||
func runQueryCases(t *testing.T, h handlerSubsonic, cases []*queryCase) {
|
||||
for _, qc := range cases {
|
||||
qc := qc // pin
|
||||
t.Run(qc.expectPath, func(t *testing.T) {
|
||||
|
||||
BIN
server/ctrlsubsonic/testdata/db
vendored
BIN
server/ctrlsubsonic/testdata/db
vendored
Binary file not shown.
Reference in New Issue
Block a user