get info about genere from musicbrainz in info

This commit is contained in:
2026-05-20 22:22:18 +02:00
parent f520cc8913
commit 0a7849ebfa
3 changed files with 68 additions and 7 deletions

View File

@@ -15,14 +15,14 @@ const (
)
type MusicBrainzClient struct {
httpClient *http.Client
userAgent string
httpClient *http.Client
userAgent string
}
func NewMusicBrainzClient() *MusicBrainzClient {
return &MusicBrainzClient{
httpClient: &http.Client{Timeout: 15 * time.Second},
userAgent: userAgent,
httpClient: &http.Client{Timeout: 30 * time.Second},
userAgent: userAgent,
}
}
@@ -224,5 +224,6 @@ func (c *MusicBrainzClient) get(endpoint string, out any) error {
if err := json.Unmarshal(body, out); err != nil {
return fmt.Errorf("decode JSON: %w", err)
}
return nil
}