fix(api): gofmt + revive cleanup on lidarr search handler
This commit is contained in:
@@ -135,4 +135,3 @@ func (h *handlers) lidarrInLibrary(ctx context.Context, kind, mbid string) (bool
|
|||||||
}
|
}
|
||||||
return exists, nil
|
return exists, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ func lidarrArtistStubBody(mbid, name string) string {
|
|||||||
// with 200 OK for any /api/v1/* path.
|
// with 200 OK for any /api/v1/* path.
|
||||||
func newLidarrStub(t *testing.T, body string) *httptest.Server {
|
func newLidarrStub(t *testing.T, body string) *httptest.Server {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
_, _ = w.Write([]byte(body))
|
_, _ = w.Write([]byte(body))
|
||||||
@@ -128,16 +128,16 @@ func TestHandleLidarrSearch_ValidationErrors(t *testing.T) {
|
|||||||
wantCode string
|
wantCode string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "bad kind playlist",
|
name: "bad kind playlist",
|
||||||
q: "Beatles",
|
q: "Beatles",
|
||||||
kind: "playlist",
|
kind: "playlist",
|
||||||
wantStatus: http.StatusBadRequest,
|
wantStatus: http.StatusBadRequest,
|
||||||
wantCode: "bad_kind",
|
wantCode: "bad_kind",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "missing query",
|
name: "missing query",
|
||||||
q: "",
|
q: "",
|
||||||
kind: "artist",
|
kind: "artist",
|
||||||
wantStatus: http.StatusBadRequest,
|
wantStatus: http.StatusBadRequest,
|
||||||
wantCode: "missing_query",
|
wantCode: "missing_query",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user