From ac806ea84d3203c2d2930deaa4fb24949779c401 Mon Sep 17 00:00:00 2001 From: Matt Gleich Date: Sun, 1 Dec 2024 17:58:25 -0500 Subject: [PATCH] fix: add missing path parts for fetchPlaylist Signed-off-by: Matt Gleich --- internal/apis/applemusic/playlists.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/apis/applemusic/playlists.go b/internal/apis/applemusic/playlists.go index aa765c0..7845763 100644 --- a/internal/apis/applemusic/playlists.go +++ b/internal/apis/applemusic/playlists.go @@ -1,6 +1,7 @@ package applemusic import ( + "fmt" "time" "github.com/gleich/lumber/v3" @@ -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