soundcloud python/php apis, recorder python script so far.
This commit is contained in:
parent
b3e111b0a0
commit
f68a8f67ea
109 changed files with 24297 additions and 10 deletions
|
@ -21,7 +21,8 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
|
|||
->add(new Zend_Acl_Resource('nowplaying'))
|
||||
->add(new Zend_Acl_Resource('search'))
|
||||
->add(new Zend_Acl_Resource('dashboard'))
|
||||
->add(new Zend_Acl_Resource('preference'));
|
||||
->add(new Zend_Acl_Resource('preference'))
|
||||
->add(new Zend_Acl_Resource('recorder'));
|
||||
|
||||
/** Creating permissions */
|
||||
$ccAcl->allow('G', 'index')
|
||||
|
@ -29,13 +30,13 @@ $ccAcl->allow('G', 'index')
|
|||
->allow('G', 'error')
|
||||
->allow('G', 'nowplaying')
|
||||
->allow('G', 'api')
|
||||
->allow('G', 'recorder')
|
||||
->allow('G', 'schedule')
|
||||
->allow('G', 'dashboard')
|
||||
->allow('H', 'library')
|
||||
->allow('H', 'search')
|
||||
->allow('H', 'plupload')
|
||||
->allow('H', 'playlist')
|
||||
->allow('H', 'sideplaylist')
|
||||
->allow('A', 'user')
|
||||
->allow('A', 'preference');
|
||||
|
||||
|
|
32
application/controllers/RecorderController.php
Normal file
32
application/controllers/RecorderController.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
class RecorderController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('contextSwitch');
|
||||
$ajaxContext->addActionContext('get-show-schedule', 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
// action body
|
||||
}
|
||||
|
||||
public function getShowScheduleAction()
|
||||
{
|
||||
//$from = $this->_getParam("from");
|
||||
//$to = $this->_getParam("to");
|
||||
|
||||
$today_timestamp = date("Y-m-d H:i:s");
|
||||
|
||||
$this->view->shows = Show::getShows($today_timestamp, null, $excludeInstance=NULL, $onlyRecord=TRUE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -110,10 +110,11 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
{
|
||||
$controller = strtolower($request->getControllerName());
|
||||
|
||||
if ($controller == 'api'){
|
||||
$this->setRoleName("G");
|
||||
|
||||
} else if (!Zend_Auth::getInstance()->hasIdentity()){
|
||||
if ($controller == 'api' || $controller == 'recorder'){
|
||||
|
||||
$this->setRoleName("G");
|
||||
}
|
||||
else if (!Zend_Auth::getInstance()->hasIdentity()){
|
||||
|
||||
if ($controller !== 'login') {
|
||||
|
||||
|
|
|
@ -175,15 +175,26 @@ class Show {
|
|||
Show::populateShowUntilLastGeneratedDate($showId);
|
||||
}
|
||||
|
||||
public static function getShows($start_timestamp, $end_timestamp, $excludeInstance=NULL) {
|
||||
public static function getShows($start_timestamp, $end_timestamp, $excludeInstance=NULL, $onlyRecord=FALSE) {
|
||||
global $CC_DBC;
|
||||
|
||||
$sql = "SELECT starts, ends, show_id, name, description, color, background_color, cc_show_instances.id AS instance_id
|
||||
FROM cc_show_instances
|
||||
LEFT JOIN cc_show ON cc_show.id = cc_show_instances.show_id
|
||||
WHERE ((starts >= '{$start_timestamp}' AND starts < '{$end_timestamp}')
|
||||
LEFT JOIN cc_show ON cc_show.id = cc_show_instances.show_id";
|
||||
|
||||
//only want shows that are starting at the time or later.
|
||||
if($onlyRecord) {
|
||||
|
||||
$sql = $sql." WHERE (starts >= '{$start_timestamp}' AND starts < timestamp '{$start_timestamp}' + interval '2 hours')";
|
||||
$sql = $sql." AND (record = TRUE)";
|
||||
}
|
||||
else {
|
||||
|
||||
$sql = $sql." WHERE ((starts >= '{$start_timestamp}' AND starts < '{$end_timestamp}')
|
||||
OR (ends > '{$start_timestamp}' AND ends <= '{$end_timestamp}')
|
||||
OR (starts <= '{$start_timestamp}' AND ends >= '{$end_timestamp}'))";
|
||||
}
|
||||
|
||||
|
||||
if(isset($excludeInstance)) {
|
||||
foreach($excludeInstance as $instance) {
|
||||
|
@ -196,7 +207,6 @@ class Show {
|
|||
}
|
||||
|
||||
//echo $sql;
|
||||
|
||||
return $CC_DBC->GetAll($sql);
|
||||
}
|
||||
|
||||
|
|
22
application/views/helpers/SoundCloudLink.php
Normal file
22
application/views/helpers/SoundCloudLink.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
require_once 'soundcloud-api/Services/Soundcloud.php';
|
||||
|
||||
class Airtime_View_Helper_SoundCloudLink extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function soundCloudLink()
|
||||
{
|
||||
$request = Zend_Controller_Front::getInstance()->getRequest();
|
||||
$host = $request->getHttpHost();
|
||||
$controller = $request->getControllerName();
|
||||
$action = $request->getActionName();
|
||||
|
||||
$redirectUrl = "http://{$host}/{$controller}/{$action}";
|
||||
|
||||
$soundcloud = new Services_Soundcloud('2CLCxcSXYzx7QhhPVHN4A', 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs', $redirectUrl);
|
||||
$authorizeUrl = $soundcloud->getAuthorizeUrl();
|
||||
|
||||
return $authorizeUrl;
|
||||
}
|
||||
}
|
||||
|
1
application/views/scripts/airtime-recorder/index.phtml
Normal file
1
application/views/scripts/airtime-recorder/index.phtml
Normal file
|
@ -0,0 +1 @@
|
|||
<br /><br /><center>View script for controller <b>AirtimeRecorder</b> and script/action name <b>index</b></center>
|
|
@ -0,0 +1 @@
|
|||
<br /><br /><center>View script for controller <b>Recorder</b> and script/action name <b>getShowSchedule</b></center>
|
1
application/views/scripts/recorder/index.phtml
Normal file
1
application/views/scripts/recorder/index.phtml
Normal file
|
@ -0,0 +1 @@
|
|||
<br /><br /><center>View script for controller <b>Recorder</b> and script/action name <b>index</b></center>
|
Loading…
Add table
Add a link
Reference in a new issue