diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index f3bf8f561..9bcba177d 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -13,6 +13,7 @@ require_once 'DB.php'; require_once 'Preference.php'; require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php'; +require_once 'soundcloud-api/Services/Soundcloud.php'; global $CC_CONFIG, $CC_DBC; $dsn = $CC_CONFIG['dsn']; diff --git a/airtime_mvc/application/configs/constants.php b/airtime_mvc/application/configs/constants.php index 0ec295c26..50008e3f8 100644 --- a/airtime_mvc/application/configs/constants.php +++ b/airtime_mvc/application/configs/constants.php @@ -37,6 +37,6 @@ define('UI_PLAYLIST_SESSNAME', 'PLAYLIST'); // Soundcloud contants -define('SOUNDCLOUD_NULL', -1); +define('SOUNDCLOUD_NOT_UPLOADED_YET', -1); define('SOUNDCLOUD_PROGRESS', -2); define('SOUNDCLOUD_ERROR', -3); diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 7d5eb0006..cd6f64da6 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -400,7 +400,7 @@ class ApiController extends Zend_Controller_Action $tags = array_merge($hosts, array($show_name)); 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); $file->setSoundCloudFileId($soundcloud_id); break; diff --git a/airtime_mvc/application/controllers/LibraryController.php b/airtime_mvc/application/controllers/LibraryController.php index 28987eb81..c69014689 100644 --- a/airtime_mvc/application/controllers/LibraryController.php +++ b/airtime_mvc/application/controllers/LibraryController.php @@ -91,7 +91,7 @@ class LibraryController extends Zend_Controller_Action $menu[] = array('action' => array('type' => 'gourl', 'url' => $url), 'title' => 'Download'); - if (Application_Model_Preference::GetDoSoundCloudUpload()) { + if (Application_Model_Preference::GetUploadToSoundcloudOption()) { $text = "Upload to Soundcloud"; if(!is_null($file->getSoundCloudId())){ $text = "Re-upload to Soundcloud"; @@ -213,7 +213,10 @@ class LibraryController extends Zend_Controller_Action $file->setDbColMetadata($formdata); $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); $this->_helper->redirector('index'); diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 64d7ae4a0..25db6011b 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -37,6 +37,8 @@ class PreferenceController extends Zend_Controller_Action Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]); 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::SetSoundCloudPassword($values["preferences_soundcloud"]["SoundCloudPassword"]); Application_Model_Preference::SetSoundCloudTags($values["preferences_soundcloud"]["SoundCloudTags"]); diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index d1ed1674d..6555f02ed 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -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/add-show.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/fullcalendar.css'); @@ -175,7 +176,7 @@ class ScheduleController extends Zend_Controller_Action if ($showEndDateHelper->getTimestamp() <= $epochNow && $show->isRecorded() - && Application_Model_Preference::GetDoSoundCloudUpload()) { + && Application_Model_Preference::GetUploadToSoundcloudOption()) { if(is_null($show->getSoundCloudFileId())){ $menu[] = array('action' => array('type' => 'fn', 'callback' => "window['uploadToSoundCloud']($id)"), diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 3ed5d35b0..65079a21d 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -20,6 +20,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm 'ViewHelper', 'Description', array('Label', array('tag' =>'dt')))); + $startDate->setAttrib('alt', 'date'); $this->addElement($startDate); // Add start time element @@ -36,6 +37,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm 'ViewHelper', 'Errors', array(array('close'=>'HtmlTag'), array('tag' => 'dd', 'closeOnly'=>true)))); + $startTime->setAttrib('alt', 'time'); $this->addElement($startTime); // Add end date element @@ -53,6 +55,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm 'ViewHelper', 'Description', array('Label', array('tag' =>'dt')))); + $endDate->setAttrib('alt', 'date'); $this->addElement($endDate); // Add end time element @@ -69,6 +72,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm 'ViewHelper', 'Errors', array(array('close'=>'HtmlTag'), array('tag' => 'dd', 'closeOnly'=>true)))); + $endTime->setAttrib('alt', 'time'); $this->addElement($endTime); // Add duration element diff --git a/airtime_mvc/application/forms/SoundcloudPreferences.php b/airtime_mvc/application/forms/SoundcloudPreferences.php index 8639c675b..b9c4c782d 100644 --- a/airtime_mvc/application/forms/SoundcloudPreferences.php +++ b/airtime_mvc/application/forms/SoundcloudPreferences.php @@ -11,13 +11,33 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm //enable soundcloud uploads $this->addElement('checkbox', 'UseSoundCloud', array( - 'label' => 'Upload Recorded Shows To SoundCloud', + 'label' => 'Automatically Upload Recorded Shows', 'required' => false, 'value' => Application_Model_Preference::GetDoSoundCloudUpload(), 'decorators' => array( '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 $this->addElement('text', 'SoundCloudUser', array( diff --git a/airtime_mvc/application/layouts/scripts/library.phtml b/airtime_mvc/application/layouts/scripts/library.phtml index e04678c0b..f84bd868c 100644 --- a/airtime_mvc/application/layouts/scripts/library.phtml +++ b/airtime_mvc/application/layouts/scripts/library.phtml @@ -20,7 +20,7 @@