mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-17 19:26:36 -07:00
chore: initial public commit
This commit is contained in:
commit
fc9054b78c
250 changed files with 32809 additions and 0 deletions
23
internal/mbz/track.go
Normal file
23
internal/mbz/track.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package mbz
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"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, err
|
||||
}
|
||||
return track, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue