Skip to content

Commit

Permalink
feat: store playlist ids
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Nov 25, 2024
1 parent 0ae9c6a commit cad8c59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/apis/applemusic/playlists.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type playlist struct {
Name string `json:"name"`
Tracks []song `json:"tracks"`
LastModified time.Time `json:"last_modified"`
ID string `json:"id"`
}

type playlistTracksResponse struct {
Expand All @@ -20,6 +21,7 @@ type playlistTracksResponse struct {

type playlistResponse struct {
Data []struct {
ID string `json:"id"`
Attributes struct {
LastModifiedDate time.Time `json:"lastModifiedDate"`
Name string `json:"name"`
Expand Down Expand Up @@ -58,5 +60,6 @@ func fetchPlaylist(id string) (playlist, error) {
Name: playlistData.Data[0].Attributes.Name,
LastModified: playlistData.Data[0].Attributes.LastModifiedDate,
Tracks: tracks,
ID: playlistData.Data[0].ID,
}, nil
}

0 comments on commit cad8c59

Please sign in to comment.