I'm building a web app using the soundcloud JavaScript SDK that should only return profiles that contain one or more tracks.
My GET request returns an array of user profiles, each including the track_count property and associated value, as expected.
However, when I follow the link to each profile, the number of tracks is often different from the value listed in the JSON (see example in images below). Crucially, in relation to my purpose, this means that it sometimes returns profiles with 0 tracks.
From my tests so far, I've found that if the values are different then the profile track count is always less than in the JSON. Could this mean that's it's including tracks that have been deleted or removed (e.g. because of copyright infringement)?
I would really appreciate if someone could shed some light on this.
Thanks!
$(document).ready(function() {
SC.initialize({
client_id: 'xxxx',
redirect_uri: 'http://localhost/callback.html'
});
SC.get('/users/12490371/followers', {
limit: page_size,
linked_partitioning: 1
}).then(function(followers) {
$(followers.collection).each(function(i) {
//console.log(followers.collection[i].track_count)
if (followers.collection[i].track_count > 10 && followers.collection[i].followers_count < 500) {
$("#list").append(
"<ul>" +
"<li class='username'>" + this.username + "</li>" +
"<li>" + this.followers_count + "</li>" +
"<li>" + this.track_count + "</li>" +
"<li><a href='" + this.permalink_url + "' target='_blank'>GO</a>" + "</li>" +
"</ul>"
);
}
});
});
});
<div id="list">
<ul>
<li class='username'>Username</li>
<li>Followers</li>
<li>Track count</li>
<li>Profile</li>
</ul>
</div>
profile view JSON view