Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
5d60a599a6
14 changed files with 94 additions and 86 deletions
|
@ -796,6 +796,7 @@ class ApiController extends Zend_Controller_Action
|
|||
{
|
||||
Logging::info("Notifying RabbitMQ to send message to pypo");
|
||||
|
||||
Application_Model_RabbitMq::SendMessageToPypo("reset_liquidsoap_bootstrap", array());
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
|
|
|
@ -190,8 +190,9 @@ class ScheduleController extends Zend_Controller_Action
|
|||
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
|
||||
try {
|
||||
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
||||
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e->getMessage());
|
||||
$this->view->show_error = true;
|
||||
|
||||
return false;
|
||||
|
@ -205,7 +206,6 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
public function uploadToSoundCloudAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$show_instance = $this->_getParam('id');
|
||||
try {
|
||||
$show_inst = new Application_Model_ShowInstance($show_instance);
|
||||
|
|
|
@ -3,14 +3,14 @@ require_once 'php-amqplib/amqp.inc';
|
|||
|
||||
class Application_Model_RabbitMq
|
||||
{
|
||||
public static $doPush = FALSE;
|
||||
public static $doPush = false;
|
||||
|
||||
/**
|
||||
* Sets a flag to push the schedule at the end of the request.
|
||||
*/
|
||||
public static function PushSchedule()
|
||||
{
|
||||
Application_Model_RabbitMq::$doPush = TRUE;
|
||||
self::$doPush = true;
|
||||
}
|
||||
|
||||
private static function sendMessage($exchange, $data)
|
||||
|
|
|
@ -558,6 +558,7 @@ WHERE st.ends > :startTime1
|
|||
AND st.starts < :endTime
|
||||
AND st.playout_status > 0
|
||||
AND si.ends > :startTime2
|
||||
AND si.modified_instance = 'f'
|
||||
ORDER BY st.starts
|
||||
SQL;
|
||||
|
||||
|
@ -578,6 +579,7 @@ WHERE st.ends > :startTime1
|
|||
AND st.starts < :rangeEnd
|
||||
AND st.playout_status > 0
|
||||
AND si.ends > :startTime2
|
||||
AND si.modified_instance = 'f'
|
||||
ORDER BY st.starts LIMIT 3
|
||||
SQL;
|
||||
|
||||
|
|
|
@ -275,8 +275,6 @@ SQL;
|
|||
|
||||
public function cancelShow($day_timestamp)
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
|
||||
$timeinfo = explode(" ", $day_timestamp);
|
||||
|
||||
CcShowDaysQuery::create()
|
||||
|
@ -284,30 +282,23 @@ SQL;
|
|||
->update(array('DbLastShow' => $timeinfo[0]));
|
||||
|
||||
$sql = <<<SQL
|
||||
UPDATE cc_show_instances
|
||||
SET modified_instance = TRUE
|
||||
SELECT id from cc_show_instances
|
||||
WHERE starts >= :dayTimestamp::TIMESTAMP
|
||||
AND show_id = :showId
|
||||
SQL;
|
||||
|
||||
Application_Common_Database::prepareAndExecute( $sql, array(
|
||||
|
||||
$rows = Application_Common_Database::prepareAndExecute( $sql, array(
|
||||
':dayTimestamp' => $day_timestamp,
|
||||
':showId' => $this->getId()), 'execute');
|
||||
':showId' => $this->getId()), 'all');
|
||||
|
||||
// check if we can safely delete the show
|
||||
$showInstancesRow = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->findOne();
|
||||
|
||||
if (is_null($showInstancesRow)) {
|
||||
$sql = <<<SQL
|
||||
DELETE FROM cc_show WHERE id = :show_id
|
||||
SQL;
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$sql, array( 'show_id' => $this->_showId ), "execute");
|
||||
$con->exec($sql);
|
||||
}
|
||||
foreach ($rows as $row) {
|
||||
try {
|
||||
$showInstance = new Application_Model_ShowInstance($row["id"]);
|
||||
$showInstance->delete($rabbitmqPush = false);
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
|
|
@ -518,7 +518,7 @@ SQL;
|
|||
return false;
|
||||
}
|
||||
|
||||
public function delete()
|
||||
public function delete($rabbitmqPush = true)
|
||||
{
|
||||
// see if it was recording show
|
||||
$recording = $this->isRecorded();
|
||||
|
@ -568,7 +568,9 @@ SQL;
|
|||
}
|
||||
}
|
||||
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
if ($rabbitmqPush) {
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
}
|
||||
|
||||
public function setRecordedFile($file_id)
|
||||
|
|
|
@ -33,7 +33,7 @@ class Application_Model_Soundcloud
|
|||
$tags = Application_Model_Preference::GetSoundCloudTags();
|
||||
}
|
||||
|
||||
$downloadable = Application_Model_Preference::GetSoundCloudDownloadbleOption() == '1'?true:false;
|
||||
$downloadable = Application_Model_Preference::GetSoundCloudDownloadbleOption() == '1';
|
||||
|
||||
$track_data = array(
|
||||
'track[sharing]' => 'private',
|
||||
|
|
|
@ -1170,7 +1170,9 @@ SQL;
|
|||
$release = $file->getDbYear();
|
||||
try {
|
||||
$soundcloud = new Application_Model_Soundcloud();
|
||||
$soundcloud_res = $soundcloud->uploadTrack($this->getFilePath(), $this->getName(), $description, $tag, $release, $genre);
|
||||
$soundcloud_res = $soundcloud->uploadTrack(
|
||||
$this->getFilePath(), $this->getName(), $description,
|
||||
$tag, $release, $genre);
|
||||
$this->setSoundCloudFileId($soundcloud_res['id']);
|
||||
$this->setSoundCloudLinkToFile($soundcloud_res['permalink_url']);
|
||||
$this->setSoundCloudUploadTime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||
|
|
|
@ -972,7 +972,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
$('#timeline-sn').click(function(){mod.selectNone();});
|
||||
|
||||
//cancel current show
|
||||
$toolbar.find('.icon-ban-circle')
|
||||
$toolbar.find('.icon-ban-circle').parent()
|
||||
.click(function() {
|
||||
var $tr,
|
||||
data,
|
||||
|
@ -1006,7 +1006,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
});
|
||||
|
||||
//jump to current
|
||||
$toolbar.find('.icon-step-forward')
|
||||
$toolbar.find('.icon-step-forward').parent()
|
||||
.click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('icon-step-forward') === true) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue