this snippet of code is throwing an error, since you're trying to call the snapshot method on library.starred which is a type of Playlist, which inherits from Models type and not the Collection one, so the snapshot method wouldn't be available at all.
Instead, you first have to load the correct property of the model (in this case, tracks, which inherits from the Collection type), and then call the snapshot method:
library.starred.load('tracks').done(function(playlist) {
playlist.snapshot(0,50).done(function(snapshot) {
// you can now access starred tracks
console.log(snapshot.get(0))
})
})
This was the only way I found to get starred tracks for the current user.
Is your doc correct?
Based on what your documentation is stating here https://developer.spotify.com/docs/apps/api/1.0/api-library.html
this snippet of code is throwing an error, since you're trying to call the
snapshot
method onlibrary.starred
which is a type ofPlaylist
, which inherits fromModels
type and not theCollection
one, so thesnapshot
method wouldn't be available at all.Instead, you first have to load the correct property of the model (in this case,
tracks
, which inherits from theCollection
type), and then call the snapshot method:This was the only way I found to get starred tracks for the current user. Is your doc correct?
Tnx.
PS: Let me know if you need further code/examples