Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get tracks of certain users #59

Open
ssalka opened this issue May 22, 2016 · 0 comments
Open

Unable to get tracks of certain users #59

ssalka opened this issue May 22, 2016 · 0 comments

Comments

@ssalka
Copy link

ssalka commented May 22, 2016

I have the following, which is triggered by submitting an angular form containing a text input for a permalink:

scope.search = function() {
    let url = baseUrl + scope.input.permalink;
    SC.get('/resolve', {url: url, client_id: client_id})
        .then(function(user) {
            SC.get('/users/' + user.id + '/tracks')
                .then(function(tracks) {
                    let n = Math.min(10, tracks.length);
                    tracks.slice(0,n).map(
                        (track) => console.log(track.title)
                    );
                });
        });
};

The code is meant to resolve the permalink to a user ID, then grab that user's latest 10 tracks (if there are that many) and log the titles. It works for most users, but sometimes fails, e.g. for permalink "feedme". Not sure why it won't work for particular users, I can't see any reason for it in the API docs/reference or the source code.

Thanks in advance for any feedback or ideas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant