Fix API endpoints: resource IDs in URL path, not query params
- artists/{artist_id}/tracks and /direct-albums: artistID in path, return ArtistTracks/ArtistAlbums with pager
- likes: /users/me/likes/{type}s/{add-multiple|remove}, IDs as body params
- queue: /queues/{queue_id}/... instead of /queue/...?queue_id=...
- radio: /rotor/station/{station_id}/info and /tracks
- concerts: /concerts/{concert_id}/info, /concerts/tab-config
- playlists: /users/{user_id}/playlists
- labels: /labels/{label_id}, /albums, /artists
- clips: /clips/will/like, /artists/{artist_id}/blocks/artist-clips
- feed: /landing3/* endpoints
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
1 parent
02a6dabcfb
commit
70c2a5cd01
12 files changed
+238
-168
No files matched your search
@@ -14,10 +14,10 @@ func (c *Client) GetConcerts(ctx context.Context, page, pageSize int) (*models.C
|
||||
"page_size": "20",
|
||||
}
|
||||
if page > 0 {
|
||||
params["page"] = fmt.Sprintf("%d", page)
|
||||
params["page"] = fmt.Sprint(page)
|
||||
}
|
||||
if pageSize > 0 {
|
||||
params["page_size"] = fmt.Sprintf("%d", pageSize)
|
||||
params["page_size"] = fmt.Sprint(pageSize)
|
||||
}
|
||||
|
||||
var result models.ConcertFeed
|
||||
@@ -37,13 +37,10 @@ func (c *Client) GetConcertFeed(ctx context.Context) (*models.ConcertFeed, error
|
||||
}
|
||||
|
||||
// GetConcertInfo gets concert info
|
||||
// GET /concerts/{concertID}/info
|
||||
func (c *Client) GetConcertInfo(ctx context.Context, concertID string) (*models.ConcertInfo, error) {
|
||||
params := map[string]string{
|
||||
"concert_id": concertID,
|
||||
}
|
||||
|
||||
var result models.ConcertInfo
|
||||
if err := c.request.Get(ctx, "/concerts/info", params, &result); err != nil {
|
||||
if err := c.request.Get(ctx, fmt.Sprintf("/concerts/%s/info", concertID), nil, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &result, nil
|
||||
@@ -59,20 +56,11 @@ func (c *Client) GetConcertLocations(ctx context.Context) (*models.ConcertLocati
|
||||
}
|
||||
|
||||
// GetConcertTabs gets concert tabs
|
||||
func (c *Client) GetConcertTabs(ctx context.Context, concertID string) ([]*models.ConcertTabConfig, error) {
|
||||
params := map[string]string{
|
||||
"concert_id": concertID,
|
||||
}
|
||||
|
||||
var result []models.ConcertTabConfig
|
||||
if err := c.request.Get(ctx, "/concerts/tabs", params, &result); err != nil {
|
||||
// GET /concerts/tab-config
|
||||
func (c *Client) GetConcertTabs(ctx context.Context) (*models.ConcertTabConfig, error) {
|
||||
var result models.ConcertTabConfig
|
||||
if err := c.request.Get(ctx, "/concerts/tab-config", nil, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
tabs := make([]*models.ConcertTabConfig, len(result))
|
||||
for i := range result {
|
||||
result[i].SetClient(c)
|
||||
tabs[i] = &result[i]
|
||||
}
|
||||
return tabs, nil
|
||||
return &result, nil
|
||||
}
|
||||
Reference in new issue
Block a user