You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Koito/internal/mbz/track.go

25 lines
524 B

package mbz
import (
"context"
"fmt"
"github.com/google/uuid"
)
type MusicBrainzTrack struct {
Title string `json:"title"`
}
const recordingFmtStr = "%s/ws/2/recording/%s"
// Returns the artist name at index 0, and all primary aliases after.
func (c *MusicBrainzClient) GetTrack(ctx context.Context, id uuid.UUID) (*MusicBrainzTrack, error) {
track := new(MusicBrainzTrack)
err := c.getEntity(ctx, recordingFmtStr, id, track)
if err != nil {
return nil, fmt.Errorf("GetTrack: %w", err)
}
return track, nil
}