Skip to content

Commit

Permalink
restricts playlist return items to tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
hayribakici committed Nov 29, 2023
1 parent 703a340 commit 3ce3f43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/src/endpoints/playlists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class Playlists extends EndpointPaging {

/// [playlistId] - the Spotify playlist ID
Pages<Track> getTracksByPlaylistId(playlistId) {
return _getPages('v1/playlists/$playlistId/tracks',
// restricting the return items to `track`
final query = _buildQuery({'additional_types': 'track'});
return _getPages('v1/playlists/$playlistId/tracks$query',
(json) => Track.fromJson(json['track']));
}

Expand Down

0 comments on commit 3ce3f43

Please sign in to comment.