fix: typos

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2026-02-07 12:23:57 -05:00
parent f4ca5ec1ca
commit eb52a344c6
3 changed files with 5 additions and 5 deletions

View File

@ -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 {

View File

@ -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())

View File

@ -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)