Skip to content

Commit

Permalink
fix: return errors from fetchPlaylist
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Nov 26, 2024
1 parent 4447aae commit 07b9572
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/apis/applemusic/playlists.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ func fetchPlaylist(id string) (playlist, error) {
)
if err != nil {
lumber.Error(err, "failed to get tracks for playlist with id of", id)
return playlist{}, nil
}
totalResponseData = append(totalResponseData, trackData.Data...)
for trackData.Next != "" {
trackData, err = sendAPIRequest[playlistTracksResponse](trackData.Next)
if err != nil {
lumber.Error(err, "failed to paginate through tracks for playlist with id of", id)
return playlist{}, nil
}
}

Expand Down

0 comments on commit 07b9572

Please sign in to comment.