diff --git a/adapters/listenbrainz/agent.go b/adapters/listenbrainz/agent.go index ccf6a19b7..4fdface35 100644 --- a/adapters/listenbrainz/agent.go +++ b/adapters/listenbrainz/agent.go @@ -213,7 +213,7 @@ func init() { conf.AddHook(func() { if conf.Server.ListenBrainz.Enabled { scrobbler.Register(listenBrainzAgentName, func(ds model.DataStore) scrobbler.Scrobbler { - // This is a workaround for the fact that a (Interface)(nil) is not the same as a (*listenBrainzConstructor)(nil) + // This is a workaround for the fact that a (Interface)(nil) is not the same as a (*listenBrainzAgent)(nil) // See https://go.dev/doc/faq#nil_error a := listenBrainzConstructor(ds) if a != nil { @@ -223,7 +223,7 @@ func init() { }) agents.Register(listenBrainzAgentName, func(ds model.DataStore) agents.Interface { - // This is a workaround for the fact that a (Interface)(nil) is not the same as a (*listenBrainzConstructor)(nil) + // This is a workaround for the fact that a (Interface)(nil) is not the same as a (*listenBrainzAgent)(nil) // See https://go.dev/doc/faq#nil_error a := listenBrainzConstructor(ds) if a != nil { diff --git a/adapters/listenbrainz/agent_test.go b/adapters/listenbrainz/agent_test.go index 699670b2f..457f3904e 100644 --- a/adapters/listenbrainz/agent_test.go +++ b/adapters/listenbrainz/agent_test.go @@ -193,7 +193,7 @@ var _ = Describe("listenBrainzAgent", func() { Expect(httpClient.SavedRequest.URL.Query().Get("artist_mbids")).To(Equal("7c2cc610-f998-43ef-a08f-dae3344b8973")) }) - It("returns error when fetch calls", func() { + It("returns error when fetch calls fails", func() { httpClient.Err = errors.New("error") _, err := agent.GetArtistURL(ctx, "", "", "7c2cc610-f998-43ef-a08f-dae3344b8973") Expect(err).To(HaveOccurred()) diff --git a/adapters/listenbrainz/client.go b/adapters/listenbrainz/client.go index 7f5a849b7..bd1994164 100644 --- a/adapters/listenbrainz/client.go +++ b/adapters/listenbrainz/client.go @@ -21,7 +21,7 @@ const ( // There are a couple of algorithms from https://labs.api.listenbrainz.org/similar-artists artistAlgorithm = "session_based_days_9000_session_300_contribution_5_threshold_15_limit_50_skip_30" // From https://labs.api.listenbrainz.org/similar-recordings - trackALgorithm = "session_based_days_180_session_300_contribution_5_threshold_15_limit_50_skip_30" + trackAlgorithm = "session_based_days_180_session_300_contribution_5_threshold_15_limit_50_skip_30" ) var ( @@ -340,7 +340,7 @@ func (c *client) getSimilarRecordings(ctx context.Context, mbid string, limit in req, _ := http.NewRequestWithContext(ctx, http.MethodGet, labsBase+"similar-recordings/json", nil) req.Header.Add("Content-Type", "application/json; charset=UTF-8") req.URL.RawQuery = url.Values{ - "recording_mbids": []string{mbid}, "algorithm": []string{trackALgorithm}, + "recording_mbids": []string{mbid}, "algorithm": []string{trackAlgorithm}, }.Encode() log.Trace(ctx, fmt.Sprintf("Sending ListenBrainz Labs %s request", req.Method), "url", req.URL)