diff --git a/internal/api/likes.go b/internal/api/likes.go index dcf5ac87..7e877fbc 100644 --- a/internal/api/likes.go +++ b/internal/api/likes.go @@ -302,4 +302,3 @@ func uuidsToStrings(ids []pgtype.UUID) []string { } return out } - diff --git a/internal/api/requests_test.go b/internal/api/requests_test.go index db22b797..c3f95a44 100644 --- a/internal/api/requests_test.go +++ b/internal/api/requests_test.go @@ -29,7 +29,7 @@ func newRequestsRouter(h *handlers) chi.Router { // withUser injects a user into the request context the same way RequireUser does. func withUser(req *http.Request, user dbq.User) *http.Request { - return withUser(req, user) + return req.WithContext(context.WithValue(req.Context(), userCtxKeyForTest(), user)) } // doCreateRequest fires POST /api/requests with the given JSON body as the given user. diff --git a/internal/coverart/provider_theaudiodb.go b/internal/coverart/provider_theaudiodb.go index f25e45a5..984502e1 100644 --- a/internal/coverart/provider_theaudiodb.go +++ b/internal/coverart/provider_theaudiodb.go @@ -112,7 +112,7 @@ func (p *theAudioDBProvider) FetchAlbumCover(ctx context.Context, ref AlbumRef) if len(resp.Album) == 0 || resp.Album[0].StrAlbumThumb == nil || *resp.Album[0].StrAlbumThumb == "" { return nil, ErrNotFound } - return p.client.getImage(ctx,*resp.Album[0].StrAlbumThumb) + return p.client.getImage(ctx, *resp.Album[0].StrAlbumThumb) } // FetchArtistArt hits /artist-mb.php?i=, parses strArtistThumb + @@ -160,7 +160,7 @@ func (p *theAudioDBProvider) FetchArtistArt(ctx context.Context, ref ArtistRef) } if thumbURL != "" { - thumb, err = p.client.getImage(ctx,thumbURL) + thumb, err = p.client.getImage(ctx, thumbURL) if err != nil && !errors.Is(err, ErrTransient) && !errors.Is(err, ErrNotFound) { return nil, nil, err } @@ -170,7 +170,7 @@ func (p *theAudioDBProvider) FetchArtistArt(ctx context.Context, ref ArtistRef) } } if fanartURL != "" { - fanart, err = p.client.getImage(ctx,fanartURL) + fanart, err = p.client.getImage(ctx, fanartURL) if err != nil && !errors.Is(err, ErrTransient) && !errors.Is(err, ErrNotFound) { return thumb, nil, err } @@ -204,4 +204,3 @@ func (p *theAudioDBProvider) TestConnection(ctx context.Context) error { } return p.client.getJSON(ctx, p.jsonURL("album-mb.php?i="+theAudioDBTestSampleMBID), &resp) } -