Comments (5)
@mhlavacka I see that the meteor wrapper only deals with authentication and it doesn't change the implementation the
getPlaylist()
function.I just realised the problem is that you want to use
.getPlaylistTracks()
to pass a limit and offset.getPlaylist()
makes a request to this endpoint that doesn't acceptlimit
noroffset
, and the options are limited tofields
andmarket
. There is no way to limit the amount of tracks you get in that request, and it will be 100 max. If you want to get the following chunk you can use the url provided in thetracks.next
field.
Can I please have an example for calling that next url, would be helpful. Thanks
from spotify-web-api-node.
@mhlavacka Limit and offset are being passed as an object to the internal request
object (see https://github.com/thelinmichael/spotify-web-api-node/blob/master/src/spotify-web-api.js#L791), so this should work. Could you provide an example of the call, or even better check what url is being requested?
from spotify-web-api-node.
I'm doing exactly this, but it returns all tracks from 0 - 30, limit : 5 and offset 0.
I'm using Meteor Spotify Web API, Meteor wrapper for your api. Guess I should at first look there.
getUserPlaylist: function(owner, playlist) {
var spotifyApi = new SpotifyWebApi();
var response = spotifyApi.getPlaylist('spotifydiscover', '0vL3R9wDeAwmXTTuRATa14', { limit : 5, offset : 10 });
if (checkTokenRefreshed(response, spotifyApi)) {
response = spotifyApi.getPlaylist('spotifydiscover', '0vL3R9wDeAwmXTTuRATa14', { limit : 5, offset : 10 });
}
return response.data.body
},
from spotify-web-api-node.
@mhlavacka I see that the meteor wrapper only deals with authentication and it doesn't change the implementation the getPlaylist()
function.
I just realised the problem is that you want to use .getPlaylistTracks()
to pass a limit and offset. getPlaylist()
makes a request to this endpoint that doesn't accept limit
nor offset
, and the options are limited to fields
and market
. There is no way to limit the amount of tracks you get in that request, and it will be 100 max. If you want to get the following chunk you can use the url provided in the tracks.next
field.
from spotify-web-api-node.
@JMPerez Thanks for a quick explanation. That's exactly what I needed.
from spotify-web-api-node.
Related Issues (20)
- Status of the Project? HOT 9
- When calling getUserPlaylists()
- [WebApiError] Error message type should be a string. HOT 1
- How to fetch more than 100 tracks from a spotify playlist at once using python HOT 1
- Multi user config HOT 1
- PSA: Avoid passing object reference to constructor to avoid state leakage HOT 1
- Missing paMissing parameter in "areFollowingPlaylist" HOT 2
- spotifyApi.setAccessToken is not a function
- Missing GetCurrentUserPlaylists fetch function HOT 1
- Unauthorized when uploading cover image
- I can't Search Track with Korean title
- Outdated Dependencies
- Is there any interest in converting this library to using `fetch`? HOT 4
- How can i get images of a track
- How can i play a track HOT 1
- Server Error 500 HOT 4
- AuthorizationCodeGrant issue HOT 2
- is_local should be an optional property of SpotifyApi.TrackObjectFull
- Invalid authorization code but return accessToken HOT 1
- Can't refresh access token
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spotify-web-api-node.