Skip to content

Commit

Permalink
fix: add missing path parts for fetchPlaylist
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 040d135 commit ac806ea
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/apis/applemusic/playlists.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package applemusic

import (
"fmt"
"time"

"github.com/gleich/lumber/v3"
Expand Down Expand Up @@ -29,14 +30,18 @@ type playlistResponse struct {
}

func fetchPlaylist(id string) (playlist, error) {
playlistData, err := sendAppleMusicAPIRequest[playlistResponse]("v1/me/library/playlist")
playlistData, err := sendAppleMusicAPIRequest[playlistResponse](
fmt.Sprintf("v1/me/library/playlists/%s", id),
)
if err != nil {
lumber.Error(err, "failed to fetch playlist for", id)
return playlist{}, err
}

var totalResponseData []songResponse
trackData, err := sendAppleMusicAPIRequest[playlistTracksResponse]("v1/me/library/playlists")
trackData, err := sendAppleMusicAPIRequest[playlistTracksResponse](
fmt.Sprintf("v1/me/library/playlists/%s/tracks", id),
)
if err != nil {
lumber.Error(err, "failed to get tracks for playlist with id of", id)
return playlist{}, err
Expand Down

0 comments on commit ac806ea

Please sign in to comment.