Merge branch 'master' of dev.sourcefabric.org:airtime

Conflicts:
	application/models/Shows.php
This commit is contained in:
paul.baranowski 2011-03-22 10:00:37 -04:00
commit b650abcbb8
24 changed files with 446 additions and 88 deletions

View file

@ -118,7 +118,7 @@ class Application_Model_Preference
Application_Model_Preference::SetValue("soundcloud_password", $password);
}
public static function GetSoundCloudUserPassword() {
public static function GetSoundCloudPassword() {
return Application_Model_Preference::GetValue("soundcloud_password");
}

View file

@ -738,6 +738,14 @@ class ShowInstance {
RabbitMq::PushSchedule();
}
public function setRecordedFile($file_id)
{
$showInstance = CcShowInstancesQuery::create()
->findPK($this->_instanceId);
$showInstance->setDbRecordedFile($file_id)
->save();
}
public function getTimeScheduled()
{
$instance_id = $this->getShowInstanceId();

View file

@ -1,31 +1,54 @@
<?php
require_once 'Soundcloud.php';
require_once 'soundcloud-api/Services/Soundcloud.php';
class ATSoundcloud {
/*
private $_soundcloud;
require_once 'Soundcloud.php';
public function __construct()
{
global $CC_CONFIG;
$this->_soundcloud = new Services_Soundcloud($CC_CONFIG['soundcloud-client-id'], $CC_CONFIG['soundcloud-client-secret']);
}
$soundcloud = new Services_Soundcloud('2CLCxcSXYzx7QhhPVHN4A', 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs');
private function getToken()
{
$username = Application_Model_Preference::GetSoundCloudUser();
$password = Application_Model_Preference::GetSoundCloudPassword();
$token = $soundcloud->accessTokenResourceOwner('naomiaro@gmail.com', 'airtime17');
if($username === "" || $password === "")
{
return false;
}
$track_data = array(
'track[sharing]' => 'private',
'track[title]' => 'Test',
'track[asset_data]' => '@/home/naomi/Music/testoutput.mp3'
);
$token = $this->_soundcloud->accessTokenResourceOwner($username, $password);
return $token;
}
public function uploadTrack($filepath, $filename)
{
if($this->getToken())
{
$track_data = array(
'track[sharing]' => 'private',
'track[title]' => $filename,
'track[asset_data]' => '@' . $filepath
);
try {
$response = json_decode(
$this->_soundcloud->post('tracks', $track_data),
true
);
}
catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
echo $e->getMessage();
echo var_dump($track_data);
}
}
}
try {
$response = json_decode(
$soundcloud->post('tracks', $track_data),
true
);
}
catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
show_error($e->getMessage());
}
*/