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
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ func lidarrArtistStubBody(mbid, name string) string {
|
||||
// with 200 OK for any /api/v1/* path.
|
||||
func newLidarrStub(t *testing.T, body string) *httptest.Server {
|
||||
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.WriteHeader(http.StatusOK)
|
||||
_, _ = w.Write([]byte(body))
|
||||
@@ -128,16 +128,16 @@ func TestHandleLidarrSearch_ValidationErrors(t *testing.T) {
|
||||
wantCode string
|
||||
}{
|
||||
{
|
||||
name: "bad kind playlist",
|
||||
q: "Beatles",
|
||||
kind: "playlist",
|
||||
name: "bad kind playlist",
|
||||
q: "Beatles",
|
||||
kind: "playlist",
|
||||
wantStatus: http.StatusBadRequest,
|
||||
wantCode: "bad_kind",
|
||||
},
|
||||
{
|
||||
name: "missing query",
|
||||
q: "",
|
||||
kind: "artist",
|
||||
name: "missing query",
|
||||
q: "",
|
||||
kind: "artist",
|
||||
wantStatus: http.StatusBadRequest,
|
||||
wantCode: "missing_query",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user