CC-2993: Playlist Builder: add "View on SoundCloud" option on the menu

- fixed
- extra fix: handles the case when username or password is empty
This commit is contained in:
James 2011-10-22 11:34:04 -04:00
parent 8b2a23b88a
commit f160ded6bc
10 changed files with 125 additions and 24 deletions

View file

@ -17,11 +17,6 @@ class Application_Model_Soundcloud {
$username = Application_Model_Preference::GetSoundCloudUser();
$password = Application_Model_Preference::GetSoundCloudPassword();
if($username === "" || $password === "")
{
return false;
}
$token = $this->_soundcloud->accessTokenResourceOwner($username, $password);
return $token;
@ -82,13 +77,13 @@ class Application_Model_Soundcloud {
if ($license != "") {
$track_data['track[license]'] = $license;
}
$response = json_decode(
$this->_soundcloud->post('tracks', $track_data),
true
);
return $response["id"];
return $response;
}
}