Right now I am using Playback.current
query to fetch the track inside a TrackItem. Every time I hit the query, I am getting a different track of next index. Instead of running the query every time, if there would be some way of fetching all the tracks of stations? Thanks.
Pandora stations are dynamic in nature. There is no fixed set of tracks for a station. The API allows you to see the current track and the next track (via calls to peek), but the next track can change even after you've peeked. For example, if somebody provides feedback on the current track (thumbs up or thumbs down), the next track may be changed.
It's possible that you are thinking of playlists which are indeed a fixed set of tracks. All Pandora listeners can enjoy stations but playlists are generally restricted to Pandora Premium subscribers (though listeners who don't have Premium can still access playlist through Premium Sessions).
If you know the ID of a playlist and you want to get all the tracks for that playlist, you can use the "entity" query to lookup the track list:
query {
entity(id: "PL:88551012:1742630896") {
... on Playlist {
name
items {
playlistItems {
entity {
... on Track {
name
artist {
name
}
}
}
}
}
}
}
}
I've used Highway Finds in the above example, but obviously you can plug in other playlist IDs (i.e. IDs that start with "PL:").
Does this answer your question?