Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
ed8cdc7db3
|
@ -13,6 +13,7 @@ require_once 'DB.php';
|
||||||
|
|
||||||
require_once 'Preference.php';
|
require_once 'Preference.php';
|
||||||
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
||||||
|
require_once 'soundcloud-api/Services/Soundcloud.php';
|
||||||
|
|
||||||
global $CC_CONFIG, $CC_DBC;
|
global $CC_CONFIG, $CC_DBC;
|
||||||
$dsn = $CC_CONFIG['dsn'];
|
$dsn = $CC_CONFIG['dsn'];
|
||||||
|
|
|
@ -37,6 +37,6 @@ define('UI_PLAYLIST_SESSNAME', 'PLAYLIST');
|
||||||
|
|
||||||
|
|
||||||
// Soundcloud contants
|
// Soundcloud contants
|
||||||
define('SOUNDCLOUD_NULL', -1);
|
define('SOUNDCLOUD_NOT_UPLOADED_YET', -1);
|
||||||
define('SOUNDCLOUD_PROGRESS', -2);
|
define('SOUNDCLOUD_PROGRESS', -2);
|
||||||
define('SOUNDCLOUD_ERROR', -3);
|
define('SOUNDCLOUD_ERROR', -3);
|
||||||
|
|
|
@ -400,7 +400,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
$tags = array_merge($hosts, array($show_name));
|
$tags = array_merge($hosts, array($show_name));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$soundcloud = new Application_Model_AtSoundcloud();
|
$soundcloud = new Application_Model_Soundcloud();
|
||||||
$soundcloud_id = $soundcloud->uploadTrack($file->getFilePath(), $tmpTitle, $description, $tags, $show_start_time, $show_genre);
|
$soundcloud_id = $soundcloud->uploadTrack($file->getFilePath(), $tmpTitle, $description, $tags, $show_start_time, $show_genre);
|
||||||
$file->setSoundCloudFileId($soundcloud_id);
|
$file->setSoundCloudFileId($soundcloud_id);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -91,7 +91,7 @@ class LibraryController extends Zend_Controller_Action
|
||||||
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
|
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
|
||||||
'title' => 'Download');
|
'title' => 'Download');
|
||||||
|
|
||||||
if (Application_Model_Preference::GetDoSoundCloudUpload()) {
|
if (Application_Model_Preference::GetUploadToSoundcloudOption()) {
|
||||||
$text = "Upload to Soundcloud";
|
$text = "Upload to Soundcloud";
|
||||||
if(!is_null($file->getSoundCloudId())){
|
if(!is_null($file->getSoundCloudId())){
|
||||||
$text = "Re-upload to Soundcloud";
|
$text = "Re-upload to Soundcloud";
|
||||||
|
@ -213,7 +213,10 @@ class LibraryController extends Zend_Controller_Action
|
||||||
$file->setDbColMetadata($formdata);
|
$file->setDbColMetadata($formdata);
|
||||||
|
|
||||||
$data = $file->getMetadata();
|
$data = $file->getMetadata();
|
||||||
|
|
||||||
|
// set MDATA_KEY_FILEPATH
|
||||||
|
$data['MDATA_KEY_FILEPATH'] = $file->getFilePath();
|
||||||
|
Logging::log($data['MDATA_KEY_FILEPATH']);
|
||||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("md_update", $data);
|
Application_Model_RabbitMq::SendMessageToMediaMonitor("md_update", $data);
|
||||||
|
|
||||||
$this->_helper->redirector('index');
|
$this->_helper->redirector('index');
|
||||||
|
|
|
@ -37,6 +37,8 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]);
|
Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]);
|
||||||
|
|
||||||
Application_Model_Preference::SetDoSoundCloudUpload($values["preferences_soundcloud"]["UseSoundCloud"]);
|
Application_Model_Preference::SetDoSoundCloudUpload($values["preferences_soundcloud"]["UseSoundCloud"]);
|
||||||
|
Application_Model_Preference::SetUploadToSoundcloudOption($values["preferences_soundcloud"]["UploadToSoundcloudOption"]);
|
||||||
|
Application_Model_Preference::SetSoundCloudDownloadbleOption($values["preferences_soundcloud"]["SoundCloudDownloadbleOption"]);
|
||||||
Application_Model_Preference::SetSoundCloudUser($values["preferences_soundcloud"]["SoundCloudUser"]);
|
Application_Model_Preference::SetSoundCloudUser($values["preferences_soundcloud"]["SoundCloudUser"]);
|
||||||
Application_Model_Preference::SetSoundCloudPassword($values["preferences_soundcloud"]["SoundCloudPassword"]);
|
Application_Model_Preference::SetSoundCloudPassword($values["preferences_soundcloud"]["SoundCloudPassword"]);
|
||||||
Application_Model_Preference::SetSoundCloudTags($values["preferences_soundcloud"]["SoundCloudTags"]);
|
Application_Model_Preference::SetSoundCloudTags($values["preferences_soundcloud"]["SoundCloudTags"]);
|
||||||
|
|
|
@ -47,6 +47,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/full-calendar-functions.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/full-calendar-functions.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/add-show.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/add-show.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/schedule.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/schedule.js','text/javascript');
|
||||||
|
$this->view->headScript()->appendFile($baseUrl.'/js/meioMask/jquery.meio.mask.js','text/javascript');
|
||||||
|
|
||||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/jquery-ui-timepicker.css');
|
$this->view->headLink()->appendStylesheet($baseUrl.'/css/jquery-ui-timepicker.css');
|
||||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/fullcalendar.css');
|
$this->view->headLink()->appendStylesheet($baseUrl.'/css/fullcalendar.css');
|
||||||
|
@ -175,7 +176,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
if ($showEndDateHelper->getTimestamp() <= $epochNow
|
if ($showEndDateHelper->getTimestamp() <= $epochNow
|
||||||
&& $show->isRecorded()
|
&& $show->isRecorded()
|
||||||
&& Application_Model_Preference::GetDoSoundCloudUpload()) {
|
&& Application_Model_Preference::GetUploadToSoundcloudOption()) {
|
||||||
if(is_null($show->getSoundCloudFileId())){
|
if(is_null($show->getSoundCloudFileId())){
|
||||||
$menu[] = array('action' => array('type' => 'fn',
|
$menu[] = array('action' => array('type' => 'fn',
|
||||||
'callback' => "window['uploadToSoundCloud']($id)"),
|
'callback' => "window['uploadToSoundCloud']($id)"),
|
||||||
|
|
|
@ -20,6 +20,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
'ViewHelper',
|
'ViewHelper',
|
||||||
'Description',
|
'Description',
|
||||||
array('Label', array('tag' =>'dt'))));
|
array('Label', array('tag' =>'dt'))));
|
||||||
|
$startDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($startDate);
|
$this->addElement($startDate);
|
||||||
|
|
||||||
// Add start time element
|
// Add start time element
|
||||||
|
@ -36,6 +37,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
'ViewHelper',
|
'ViewHelper',
|
||||||
'Errors',
|
'Errors',
|
||||||
array(array('close'=>'HtmlTag'), array('tag' => 'dd', 'closeOnly'=>true))));
|
array(array('close'=>'HtmlTag'), array('tag' => 'dd', 'closeOnly'=>true))));
|
||||||
|
$startTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($startTime);
|
$this->addElement($startTime);
|
||||||
|
|
||||||
// Add end date element
|
// Add end date element
|
||||||
|
@ -53,6 +55,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
'ViewHelper',
|
'ViewHelper',
|
||||||
'Description',
|
'Description',
|
||||||
array('Label', array('tag' =>'dt'))));
|
array('Label', array('tag' =>'dt'))));
|
||||||
|
$endDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($endDate);
|
$this->addElement($endDate);
|
||||||
|
|
||||||
// Add end time element
|
// Add end time element
|
||||||
|
@ -69,6 +72,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
'ViewHelper',
|
'ViewHelper',
|
||||||
'Errors',
|
'Errors',
|
||||||
array(array('close'=>'HtmlTag'), array('tag' => 'dd', 'closeOnly'=>true))));
|
array(array('close'=>'HtmlTag'), array('tag' => 'dd', 'closeOnly'=>true))));
|
||||||
|
$endTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($endTime);
|
$this->addElement($endTime);
|
||||||
|
|
||||||
// Add duration element
|
// Add duration element
|
||||||
|
|
|
@ -11,13 +11,33 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
//enable soundcloud uploads
|
//enable soundcloud uploads
|
||||||
$this->addElement('checkbox', 'UseSoundCloud', array(
|
$this->addElement('checkbox', 'UseSoundCloud', array(
|
||||||
'label' => 'Upload Recorded Shows To SoundCloud',
|
'label' => 'Automatically Upload Recorded Shows',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'value' => Application_Model_Preference::GetDoSoundCloudUpload(),
|
'value' => Application_Model_Preference::GetDoSoundCloudUpload(),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
//enable soundcloud uploads option
|
||||||
|
$this->addElement('checkbox', 'UploadToSoundcloudOption', array(
|
||||||
|
'label' => 'Enable Soundcloud Upload',
|
||||||
|
'required' => false,
|
||||||
|
'value' => Application_Model_Preference::GetUploadToSoundcloudOption(),
|
||||||
|
'decorators' => array(
|
||||||
|
'ViewHelper'
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
//enable downloadable for soundcloud
|
||||||
|
$this->addElement('checkbox', 'SoundCloudDownloadbleOption', array(
|
||||||
|
'label' => 'Automatically Mark Files "Downloadable" on SoundCloud',
|
||||||
|
'required' => false,
|
||||||
|
'value' => Application_Model_Preference::GetSoundCloudDownloadbleOption(),
|
||||||
|
'decorators' => array(
|
||||||
|
'ViewHelper'
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
//SoundCloud Username
|
//SoundCloud Username
|
||||||
$this->addElement('text', 'SoundCloudUser', array(
|
$this->addElement('text', 'SoundCloudUser', array(
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!--Set to z-index 254 to make it lower than the top-panel and the ZFDebug info bar, but higher than the side-playlist-->
|
<!--Set to z-index 254 to make it lower than the top-panel and the ZFDebug info bar, but higher than the side-playlist-->
|
||||||
<div id="library_content" class="tabs ui-widget ui-widget-content block-shadow omega-block padded" style="z-index:254"><?php echo $this->layout()->library ?></div>
|
<div id="library_content" class="tabs ui-widget ui-widget-content block-shadow alpha-block padded" style="z-index:254"><?php echo $this->layout()->library ?></div>
|
||||||
<div id="side_playlist" class="ui-widget ui-widget-content block-shadow omega-block"><?php echo $this->layout()->spl ?></div>
|
<div id="side_playlist" class="ui-widget ui-widget-content block-shadow omega-block"><?php echo $this->layout()->spl ?></div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -432,11 +432,30 @@ class Application_Model_Preference
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetEnableStreamConf(){
|
public static function GetEnableStreamConf(){
|
||||||
|
if(self::GetValue("enable_stream_conf") == Null){
|
||||||
|
return "true";
|
||||||
|
}
|
||||||
return self::GetValue("enable_stream_conf");
|
return self::GetValue("enable_stream_conf");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetAirtimeVersion(){
|
public static function GetAirtimeVersion(){
|
||||||
return self::GetValue("system_version");
|
return self::GetValue("system_version");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function SetUploadToSoundcloudOption($upload) {
|
||||||
|
self::SetValue("soundcloud_upload_option", $upload);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetUploadToSoundcloudOption() {
|
||||||
|
return self::GetValue("soundcloud_upload_option");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function SetSoundCloudDownloadbleOption($upload) {
|
||||||
|
self::SetValue("soundcloud_downloadable", $upload);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetSoundCloudDownloadbleOption() {
|
||||||
|
return self::GetValue("soundcloud_downloadable");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once 'soundcloud-api/Services/Soundcloud.php';
|
class Application_Model_Soundcloud {
|
||||||
|
|
||||||
class Application_Model_AtSoundcloud {
|
|
||||||
|
|
||||||
private $_soundcloud;
|
private $_soundcloud;
|
||||||
|
|
||||||
|
@ -40,13 +38,15 @@ class Application_Model_AtSoundcloud {
|
||||||
$tags = Application_Model_Preference::GetSoundCloudTags();
|
$tags = Application_Model_Preference::GetSoundCloudTags();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$downloadable = Application_Model_Preference::GetSoundCloudDownloadbleOption() == '1'?true:false;
|
||||||
|
|
||||||
$track_data = array(
|
$track_data = array(
|
||||||
'track[sharing]' => 'private',
|
'track[sharing]' => 'private',
|
||||||
'track[title]' => $filename,
|
'track[title]' => $filename,
|
||||||
'track[asset_data]' => '@' . $filepath,
|
'track[asset_data]' => '@' . $filepath,
|
||||||
'track[tag_list]' => $tags,
|
'track[tag_list]' => $tags,
|
||||||
'track[description]' => $description,
|
'track[description]' => $description,
|
||||||
'track[downloadable]' => true,
|
'track[downloadable]' => $downloadable,
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -931,21 +931,20 @@ class Application_Model_StoredFile {
|
||||||
public function uploadToSoundCloud()
|
public function uploadToSoundCloud()
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
global $CC_CONFIG;
|
||||||
|
|
||||||
$file = $this->_file;
|
$file = $this->_file;
|
||||||
if(is_null($file)) {
|
if(is_null($file)) {
|
||||||
return "File does not exist";
|
return "File does not exist";
|
||||||
}
|
}
|
||||||
if(Application_Model_Preference::GetDoSoundCloudUpload())
|
if(Application_Model_Preference::GetUploadToSoundcloudOption())
|
||||||
{
|
{
|
||||||
for($i=0; $i<$CC_CONFIG['soundcloud-connection-retries']; $i++) {
|
for($i=0; $i<$CC_CONFIG['soundcloud-connection-retries']; $i++) {
|
||||||
$description = $file->getDbTrackTitle();
|
$description = $file->getDbTrackTitle();
|
||||||
$tag = "";
|
$tag = "";
|
||||||
$genre = $file->getDbGenre();
|
$genre = $file->getDbGenre();
|
||||||
$release = $file->getDbYear();
|
$release = $file->getDbYear();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$soundcloud = new Application_Model_AtSoundcloud();
|
$soundcloud = new Application_Model_Soundcloud();
|
||||||
$soundcloud_id = $soundcloud->uploadTrack($this->getFilePath(), $this->getName(), $description, $tag, $release, $genre);
|
$soundcloud_id = $soundcloud->uploadTrack($this->getFilePath(), $this->getName(), $description, $tag, $release, $genre);
|
||||||
$this->setSoundCloudFileId($soundcloud_id);
|
$this->setSoundCloudFileId($soundcloud_id);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,6 +1,19 @@
|
||||||
<fieldset class="padded">
|
<fieldset class="padded">
|
||||||
<dl class="zend_form">
|
<dl class="zend_form">
|
||||||
<dd id="UseSoundCloud-element" class="block-display" style=" margin:6px 0 10px 0">
|
<dd id="UploadToSoundcloudOption-element" class="block-display" style=" margin:6px 0 10px 0">
|
||||||
|
<label class="optional" for="UploadToSoundcloudOption">
|
||||||
|
<?php echo $this->element->getElement('UploadToSoundcloudOption') ?>
|
||||||
|
<strong><?php echo $this->element->getElement('UploadToSoundcloudOption')->getLabel() ?></strong>
|
||||||
|
</label>
|
||||||
|
<?php if($this->element->getElement('UploadToSoundcloudOption')->hasErrors()) : ?>
|
||||||
|
<ul class='errors'>
|
||||||
|
<?php foreach($this->element->getElement('UploadToSoundcloudOption')->getMessages() as $error): ?>
|
||||||
|
<li><?php echo $error; ?></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
</dd>
|
||||||
|
<dd id="UseSoundCloud-element" class="block-display" style="padding-left:20px; margin:6px 0 10px 0">
|
||||||
<label class="optional" for="UseSoundCloud">
|
<label class="optional" for="UseSoundCloud">
|
||||||
<?php echo $this->element->getElement('UseSoundCloud') ?>
|
<?php echo $this->element->getElement('UseSoundCloud') ?>
|
||||||
<strong><?php echo $this->element->getElement('UseSoundCloud')->getLabel() ?></strong>
|
<strong><?php echo $this->element->getElement('UseSoundCloud')->getLabel() ?></strong>
|
||||||
|
@ -13,6 +26,19 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dd id="SoundCloudDownloadbleOption-element" class="block-display" style="padding-left:20px; margin:6px 0 10px 0">
|
||||||
|
<label class="optional" for="SoundCloudDownloadbleOption">
|
||||||
|
<?php echo $this->element->getElement('SoundCloudDownloadbleOption') ?>
|
||||||
|
<strong><?php echo $this->element->getElement('SoundCloudDownloadbleOption')->getLabel() ?></strong>
|
||||||
|
</label>
|
||||||
|
<?php if($this->element->getElement('SoundCloudDownloadbleOption')->hasErrors()) : ?>
|
||||||
|
<ul class='errors'>
|
||||||
|
<?php foreach($this->element->getElement('SoundCloudDownloadbleOption')->getMessages() as $error): ?>
|
||||||
|
<li><?php echo $error; ?></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
</dd>
|
||||||
<dt id="SoundCloudUser-label" class="block-display">
|
<dt id="SoundCloudUser-label" class="block-display">
|
||||||
<label class="optional" for="SoundCloudUser"><?php echo $this->element->getElement('SoundCloudUser')->getLabel() ?></label>
|
<label class="optional" for="SoundCloudUser"><?php echo $this->element->getElement('SoundCloudUser')->getLabel() ?></label>
|
||||||
</dt>
|
</dt>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
$s_name = "s".$this->stream_number;
|
$s_name = "s".$this->stream_number;
|
||||||
?>
|
?>
|
||||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>Stream <?php echo $this->stream_number?></h3>
|
<h3 class="collapsible-header"><span class="arrow-icon"></span>Stream <?php echo $this->stream_number?></h3>
|
||||||
<div class="stream-setting-content" id="<?=$s_name?>-config">
|
<div class="stream-setting-content" <?php echo $this->stream_number != '1'?'style="display: none;':''?> id="<?=$s_name?>-config">
|
||||||
<fieldset class="padded">
|
<fieldset class="padded">
|
||||||
<dl class="zend_form clearfix">
|
<dl class="zend_form clearfix">
|
||||||
<dt id="<?=$s_name?>Enabled-label">
|
<dt id="<?=$s_name?>Enabled-label">
|
||||||
|
@ -64,10 +64,10 @@
|
||||||
Additional Options
|
Additional Options
|
||||||
</legend>
|
</legend>
|
||||||
<dl class="zend_form">
|
<dl class="zend_form">
|
||||||
<dt id="outputUser-label" class="block-display">
|
<dt id="outputUser-label">
|
||||||
<label for="outputUser"><?php echo $this->element->getElement('user')->getLabel()?> :</label>
|
<label for="outputUser"><?php echo $this->element->getElement('user')->getLabel()?> :</label>
|
||||||
</dt>
|
</dt>
|
||||||
<dd id="outputUser-element" class="block-display">
|
<dd id="outputUser-element">
|
||||||
<?php echo $this->element->getElement('user')?>
|
<?php echo $this->element->getElement('user')?>
|
||||||
<?php if($this->element->getElement('user')->hasErrors()) : ?>
|
<?php if($this->element->getElement('user')->hasErrors()) : ?>
|
||||||
<ul class='errors'>
|
<ul class='errors'>
|
||||||
|
@ -77,10 +77,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
<dt id="outputPassword-label" class="block-display">
|
<dt id="outputPassword-label">
|
||||||
<label class="optional" for="outputPassword"><?php echo $this->element->getElement('pass')->getLabel()?> :</label>
|
<label class="optional" for="outputPassword"><?php echo $this->element->getElement('pass')->getLabel()?> :</label>
|
||||||
</dt>
|
</dt>
|
||||||
<dd id="outputPassword-element" class="block-display clearfix">
|
<dd id="outputPassword-element" class="clearfix">
|
||||||
<?php echo $this->element->getElement('pass')?>
|
<?php echo $this->element->getElement('pass')?>
|
||||||
<?php if($this->element->getElement('pass')->hasErrors()) : ?>
|
<?php if($this->element->getElement('pass')->hasErrors()) : ?>
|
||||||
<ul class='errors'>
|
<ul class='errors'>
|
||||||
|
@ -93,10 +93,10 @@
|
||||||
<dt class="block-display info-block">
|
<dt class="block-display info-block">
|
||||||
The following info will be displayed to listeners in their media player:
|
The following info will be displayed to listeners in their media player:
|
||||||
</dt>
|
</dt>
|
||||||
<dt id="stationDescription-label" class="block-display">
|
<dt id="stationDescription-label">
|
||||||
<label for="stationDescription"><?php echo $this->element->getElement('description')->getLabel()?> :</label>
|
<label for="stationDescription"><?php echo $this->element->getElement('description')->getLabel()?> :</label>
|
||||||
</dt>
|
</dt>
|
||||||
<dd id="stationDescription-element" class="block-display clearfix">
|
<dd id="stationDescription-element" class="clearfix">
|
||||||
<?php echo $this->element->getElement('description')?>
|
<?php echo $this->element->getElement('description')?>
|
||||||
<?php if($this->element->getElement('description')->hasErrors()) : ?>
|
<?php if($this->element->getElement('description')->hasErrors()) : ?>
|
||||||
<ul class='errors'>
|
<ul class='errors'>
|
||||||
|
@ -106,10 +106,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
<dt id="stationURL-label" class="block-display">
|
<dt id="stationURL-label">
|
||||||
<label for="stationURL"><?php echo $this->element->getElement('url')->getLabel()?> :</label>
|
<label for="stationURL"><?php echo $this->element->getElement('url')->getLabel()?> :</label>
|
||||||
</dt>
|
</dt>
|
||||||
<dd id="stationURL-element" class="block-display clearfix">
|
<dd id="stationURL-element" class="clearfix">
|
||||||
<?php echo $this->element->getElement('url')?>
|
<?php echo $this->element->getElement('url')?>
|
||||||
<span class="info-text-small">(Your radio station website)</span>
|
<span class="info-text-small">(Your radio station website)</span>
|
||||||
<?php if($this->element->getElement('url')->hasErrors()) : ?>
|
<?php if($this->element->getElement('url')->hasErrors()) : ?>
|
||||||
|
@ -120,10 +120,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
<dt id="outputGenre-label" class="block-display">
|
<dt id="outputGenre-label">
|
||||||
<label for="outputGenre"><?php echo $this->element->getElement('genre')->getLabel()?> :</label>
|
<label for="outputGenre"><?php echo $this->element->getElement('genre')->getLabel()?> :</label>
|
||||||
</dt>
|
</dt>
|
||||||
<dd id="outputGenre-element" class="block-display">
|
<dd id="outputGenre-element">
|
||||||
<?php echo $this->element->getElement('genre')?>
|
<?php echo $this->element->getElement('genre')?>
|
||||||
<?php if($this->element->getElement('genre')->hasErrors()) : ?>
|
<?php if($this->element->getElement('genre')->hasErrors()) : ?>
|
||||||
<ul class='errors'>
|
<ul class='errors'>
|
||||||
|
@ -133,10 +133,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
<dt id="outputMountpoint-label" class="block-display">
|
<dt id="outputMountpoint-label">
|
||||||
<label for="outputMountpoint"><?php echo $this->element->getElement('mount')->getLabel()?> :</label>
|
<label for="outputMountpoint"><?php echo $this->element->getElement('mount')->getLabel()?> :</label>
|
||||||
</dt>
|
</dt>
|
||||||
<dd id="outputMountpoint-element" class="block-display">
|
<dd id="outputMountpoint-element">
|
||||||
<?php echo $this->element->getElement('mount')?>
|
<?php echo $this->element->getElement('mount')?>
|
||||||
<?php if($this->element->getElement('mount')->hasErrors()) : ?>
|
<?php if($this->element->getElement('mount')->hasErrors()) : ?>
|
||||||
<ul class='errors'>
|
<ul class='errors'>
|
||||||
|
@ -148,11 +148,11 @@
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<dt id="outputStreamURL-label" class="block-display">
|
<dt id="outputStreamURL-label">
|
||||||
<label for="outputStreamURL">Stream URL: </label>
|
<label for="outputStreamURL">Stream URL: </label>
|
||||||
</dt>
|
</dt>
|
||||||
<dd id="outputStreamURL-element" class="block-display">
|
<dd id="outputStreamURL-element">
|
||||||
<p id="stream_url"></p>
|
<span id="stream_url"></span>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
<style type="text/css">
|
||||||
|
#plupload_files input[type="file"] {
|
||||||
|
font-size: 200px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<form id="plupload_form">
|
<form id="plupload_form">
|
||||||
<div id="plupload_files"></div>
|
<div id="plupload_files"></div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong stream-config">
|
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong stream-config">
|
||||||
<h2 style="float:left">Stream Settings</h2>
|
<h2 <?php if($this->enable_stream_conf == "true"){?>style="float:left"<?php }?>>Stream Settings</h2>
|
||||||
<?php if($this->enable_stream_conf == "true"){?>
|
<?php if($this->enable_stream_conf == "true"){?>
|
||||||
<form method="post" action="/Preference/stream-setting" enctype="application/x-www-form-urlencoded">
|
<form method="post" action="/Preference/stream-setting" enctype="application/x-www-form-urlencoded">
|
||||||
<div class="button-bar bottom" id="submit-element" style="float:right">
|
<div class="button-bar bottom" id="submit-element" style="float:right">
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 484 B After Width: | Height: | Size: 1.2 KiB |
|
@ -1566,6 +1566,10 @@ div.success{
|
||||||
background:url(images/icon_soundcloud.png) no-repeat 0 0;
|
background:url(images/icon_soundcloud.png) no-repeat 0 0;
|
||||||
width:21px;
|
width:21px;
|
||||||
}
|
}
|
||||||
|
.small-icon.sc-error {
|
||||||
|
background:url(images/icon_soundcloud_error2.png) no-repeat 0 0;
|
||||||
|
width:21px;
|
||||||
|
}
|
||||||
.small-icon.progress {
|
.small-icon.progress {
|
||||||
background:url(images/upload-icon.gif) no-repeat;
|
background:url(images/upload-icon.gif) no-repeat;
|
||||||
background-color:black;
|
background-color:black;
|
||||||
|
|
|
@ -154,8 +154,12 @@ function dtDrawCallback() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function addProgressIcon(id) {
|
function addProgressIcon(id) {
|
||||||
$("#au_"+id).find("td:eq(0)").append('<span id="'+id+'" class="small-icon progress"></span>')
|
if($("#au_"+id).find("td:eq(0)").find("span").length > 0){
|
||||||
$("span[id="+id+"]").addClass("progress");
|
$("#au_"+id).find("td:eq(0)").find("span").removeClass();
|
||||||
|
$("span[id="+id+"]").addClass("small-icon progress");
|
||||||
|
}else{
|
||||||
|
$("#au_"+id).find("td:eq(0)").append('<span id="'+id+'" class="small-icon progress"></span>')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkSCUploadStatus(){
|
function checkSCUploadStatus(){
|
||||||
|
|
|
@ -69,6 +69,7 @@ function setWatchedDirEvents() {
|
||||||
|
|
||||||
function(json) {
|
function(json) {
|
||||||
$("#watched-folder-section").empty();
|
$("#watched-folder-section").empty();
|
||||||
|
$("#watched-folder-section").append("<h2>Manage Media Folders</h2>");
|
||||||
$("#watched-folder-section").append(json.subform);
|
$("#watched-folder-section").append(json.subform);
|
||||||
setWatchedDirEvents();
|
setWatchedDirEvents();
|
||||||
});
|
});
|
||||||
|
@ -86,6 +87,7 @@ function setWatchedDirEvents() {
|
||||||
|
|
||||||
function(json) {
|
function(json) {
|
||||||
$("#watched-folder-section").empty();
|
$("#watched-folder-section").empty();
|
||||||
|
$("#watched-folder-section").append("<h2>Manage Media Folders</h2>");
|
||||||
$("#watched-folder-section").append(json.subform);
|
$("#watched-folder-section").append(json.subform);
|
||||||
setWatchedDirEvents();
|
setWatchedDirEvents();
|
||||||
});
|
});
|
||||||
|
|
|
@ -120,6 +120,12 @@ $(document).ready(function() {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.collapsible-header').click(function() {
|
||||||
|
$(this).next().toggle('fast');
|
||||||
|
$(this).toggleClass("close");
|
||||||
|
return false;
|
||||||
|
})
|
||||||
|
|
||||||
showErrorSections()
|
showErrorSections()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -419,10 +419,16 @@ function showErrorSections() {
|
||||||
$("#schedule-record-rebroadcast").show();
|
$("#schedule-record-rebroadcast").show();
|
||||||
$("#add_show_rebroadcast_relative").show();
|
$("#add_show_rebroadcast_relative").show();
|
||||||
}
|
}
|
||||||
|
$('input:text').setMask()
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$.mask.masks = $.extend($.mask.masks,{
|
||||||
|
date:{ mask: '9999-19-39'},
|
||||||
|
time:{ mask: '29:69'}
|
||||||
|
})
|
||||||
|
|
||||||
|
$('input:text').setMask()
|
||||||
//setAddShowEvents();
|
//setAddShowEvents();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -438,6 +444,13 @@ $(window).resize(function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).load(function() {
|
$(window).load(function() {
|
||||||
|
$.mask.masks = $.extend($.mask.masks,{
|
||||||
|
date:{ mask: '9999-19-39'},
|
||||||
|
time:{ mask: '29:69'}
|
||||||
|
})
|
||||||
|
|
||||||
|
$('input:text').setMask()
|
||||||
|
|
||||||
setAddShowEvents();
|
setAddShowEvents();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -462,4 +462,11 @@ class AirtimeInstall
|
||||||
fwrite($fp, "$minute $hour * * * root /usr/lib/airtime/utils/phone_home_stat\n");
|
fwrite($fp, "$minute $hour * * * root /usr/lib/airtime/utils/phone_home_stat\n");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function removeVirtualEnvDistributeFile(){
|
||||||
|
echo "* Removing distribute-0.6.10.tar.gz".PHP_EOL;
|
||||||
|
if(file_exists('/usr/share/python-virtualenv/distribute-0.6.10.tar.gz')){
|
||||||
|
exec("rm -f /usr/share/python-virtualenv/distribute-0.6.10.tar.gz");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@ if ($results == 0) {
|
||||||
AirtimeInstall::RemoveSymlinks();
|
AirtimeInstall::RemoveSymlinks();
|
||||||
AirtimeInstall::UninstallBinaries();
|
AirtimeInstall::UninstallBinaries();
|
||||||
AirtimeInstall::RemoveLogDirectories();
|
AirtimeInstall::RemoveLogDirectories();
|
||||||
|
AirtimeInstall::removeVirtualEnvDistributeFile();
|
||||||
AirtimeIni::RemoveMonitFile();
|
AirtimeIni::RemoveMonitFile();
|
||||||
|
|
||||||
@unlink('/etc/cron.d/airtime-crons');
|
@unlink('/etc/cron.d/airtime-crons');
|
||||||
|
|
|
@ -422,12 +422,12 @@ class AirTimeApiClient(ApiClientInterface):
|
||||||
elapsed = (time.time() - start)
|
elapsed = (time.time() - start)
|
||||||
logger.info("time taken to get response %s", elapsed)
|
logger.info("time taken to get response %s", elapsed)
|
||||||
|
|
||||||
if(is_record):
|
if("error" not in response and is_record):
|
||||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["upload_recorded"])
|
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["upload_recorded"])
|
||||||
url = url.replace("%%fileid%%", str(response[u'id']))
|
url = url.replace("%%fileid%%", str(response[u'id']))
|
||||||
url = url.replace("%%showinstanceid%%", str(md['MDATA_KEY_TRACKNUMBER']))
|
url = url.replace("%%showinstanceid%%", str(md['MDATA_KEY_TRACKNUMBER']))
|
||||||
logger.debug(url)
|
|
||||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||||
|
logger.debug(url)
|
||||||
|
|
||||||
req = urllib2.Request(url)
|
req = urllib2.Request(url)
|
||||||
response = urllib2.urlopen(req).read()
|
response = urllib2.urlopen(req).read()
|
||||||
|
|
|
@ -125,7 +125,7 @@ class AirtimeMetadata:
|
||||||
self.logger.debug("Saving %s to file", key)
|
self.logger.debug("Saving %s to file", key)
|
||||||
self.logger.debug(value)
|
self.logger.debug(value)
|
||||||
if isinstance(value, basestring) and (len(value) > 0):
|
if isinstance(value, basestring) and (len(value) > 0):
|
||||||
airtime_file[self.airtime2mutagen[key]] = unicode(value, "utf-8")
|
airtime_file[self.airtime2mutagen[key]] = api_client.encode_to(value, 'utf-8')
|
||||||
elif isinstance(value, int):
|
elif isinstance(value, int):
|
||||||
airtime_file[self.airtime2mutagen[key]] = str(value)
|
airtime_file[self.airtime2mutagen[key]] = str(value)
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ class AirtimeProcessEvent(ProcessEvent):
|
||||||
self.md_manager = AirtimeMetadata()
|
self.md_manager = AirtimeMetadata()
|
||||||
self.mmc = mmc
|
self.mmc = mmc
|
||||||
self.api_client = api_client
|
self.api_client = api_client
|
||||||
|
self.create_dict = {}
|
||||||
|
|
||||||
def add_filepath_to_ignore(self, filepath):
|
def add_filepath_to_ignore(self, filepath):
|
||||||
self.ignore_event.add(filepath)
|
self.ignore_event.add(filepath)
|
||||||
|
@ -87,6 +88,14 @@ class AirtimeProcessEvent(ProcessEvent):
|
||||||
else:
|
else:
|
||||||
self.logger.info("Removing the watch folder failed: %s", res['msg']['error'])
|
self.logger.info("Removing the watch folder failed: %s", res['msg']['error'])
|
||||||
|
|
||||||
|
def process_IN_CREATE(self, event):
|
||||||
|
self.logger.info("event: %s", event)
|
||||||
|
if not event.dir:
|
||||||
|
if self.mmc.is_parent_directory(event.pathname, self.config.recorded_directory):
|
||||||
|
self.file_events.append({'mode': self.config.MODE_CREATE, 'filepath': event.pathname, 'is_recorded_show': True})
|
||||||
|
self.create_dict[event.pathname] = time.time()
|
||||||
|
|
||||||
|
|
||||||
#event.dir: True if the event was raised against a directory.
|
#event.dir: True if the event was raised against a directory.
|
||||||
#event.name: filename
|
#event.name: filename
|
||||||
#event.pathname: pathname (str): Concatenation of 'path' and 'name'.
|
#event.pathname: pathname (str): Concatenation of 'path' and 'name'.
|
||||||
|
@ -94,7 +103,10 @@ class AirtimeProcessEvent(ProcessEvent):
|
||||||
# copy was done. Hence, IN_CLOSE_WRITE is the correct one to handle.
|
# copy was done. Hence, IN_CLOSE_WRITE is the correct one to handle.
|
||||||
def process_IN_CLOSE_WRITE(self, event):
|
def process_IN_CLOSE_WRITE(self, event):
|
||||||
self.logger.info("event: %s", event)
|
self.logger.info("event: %s", event)
|
||||||
self.handle_created_file(event.dir, event.pathname, event.name)
|
self.logger.info("create_dict: %s", self.create_dict)
|
||||||
|
if event.pathname in self.create_dict:
|
||||||
|
self.create_dict.pop(event.pathname)
|
||||||
|
self.handle_created_file(event.dir, event.pathname, event.name)
|
||||||
|
|
||||||
def handle_created_file(self, dir, pathname, name):
|
def handle_created_file(self, dir, pathname, name):
|
||||||
if not dir:
|
if not dir:
|
||||||
|
@ -255,6 +267,10 @@ class AirtimeProcessEvent(ProcessEvent):
|
||||||
del self.cookies_IN_MOVED_FROM[k]
|
del self.cookies_IN_MOVED_FROM[k]
|
||||||
self.handle_removed_file(False, event.pathname)
|
self.handle_removed_file(False, event.pathname)
|
||||||
|
|
||||||
|
for k, t in self.create_dict.items():
|
||||||
|
now = time.time()
|
||||||
|
if now - t > 5:
|
||||||
|
del self.create_dict[k]
|
||||||
|
|
||||||
#check for any events received from Airtime.
|
#check for any events received from Airtime.
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue