jxnblk / SoundRad

A Radically Simpler & Faster SoundCloud Player
http://soundrad.com
77 stars 13 forks source link

Fix user profile url when username is a number #39

Closed itsbrnrd closed 5 years ago

itsbrnrd commented 10 years ago

In the user's profile page, if user's name is a number, the name is interpreted as user's id.

Example:

http://soundcloud.com/2080 points to 2080's profile page whereas http://soundrad.com/2080 shows DJ jaystarseven (user_id = 2080) informations.

It seems that the problem comes from SoundCloud JS SDK.

SC.get("/users/2080", function(data) { console.log(data); });

gives :

{
  id: 2080,
  kind: "user",
  permalink: "jaystarseven",
  username: "DJ JayStarSeven",
  uri: "https://api.soundcloud.com/users/2080"
  ...
}

instead of

{
  id: 49584,
  kind: "user",
  permalink: "2080",
  username: "208O",
  uri: "https://api.soundcloud.com/users/49584"
  ...
}

Possible fix

Use SoundCloud's resolve mechanic instead of SC.get()