Skip to content

Commit

Permalink
fix: use apple music specific request for recently played
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Dec 1, 2024
1 parent ac806ea commit 616908a
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions internal/apis/applemusic/recent.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
package applemusic

import (
"net/http"
"net/url"

"github.com/gleich/lcp-v2/internal/apis"
"github.com/gleich/lumber/v3"
)

type recentlyPlayedResponse struct {
Data []songResponse `json:"data"`
}

func fetchRecentlyPlayed() ([]song, error) {
u, err := url.JoinPath(API_ENDPOINT, "v1/me/recent/played/tracks")
if err != nil {
lumber.Error(err, "failed to create URl")
return []song{}, err
}
req, err := http.NewRequest("GET", u, nil)
if err != nil {
lumber.Error(err, "failed to create request")
return []song{}, err
}
response, err := apis.SendRequest[recentlyPlayedResponse](req)
response, err := sendAppleMusicAPIRequest[recentlyPlayedResponse]("v1/me/recent/played/tracks")
if err != nil {
return []song{}, err
}
Expand Down

0 comments on commit 616908a

Please sign in to comment.