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

This commit is contained in:
martin 2011-04-04 12:30:37 -04:00
commit 7823d89092
31 changed files with 871 additions and 171 deletions

View File

@ -125,6 +125,8 @@
<formFile formName="AddShowRR"/> <formFile formName="AddShowRR"/>
<formFile formName="AddShowRebroadcastDates"/> <formFile formName="AddShowRebroadcastDates"/>
<formFile formName="AddShowAbsoluteRebroadcastDates"/> <formFile formName="AddShowAbsoluteRebroadcastDates"/>
<formFile formName="SoundcloudPreferences"/>
<formFile formName="GeneralPreferences"/>
</formsDirectory> </formsDirectory>
<layoutsDirectory enabled="false"/> <layoutsDirectory enabled="false"/>
<modelsDirectory> <modelsDirectory>

View File

@ -257,7 +257,10 @@ class ApiController extends Zend_Controller_Action
} }
$today_timestamp = date("Y-m-d H:i:s"); $today_timestamp = date("Y-m-d H:i:s");
$this->view->shows = Show::getShows($today_timestamp, null, $excludeInstance=NULL, $onlyRecord=TRUE); $now = new DateTime($today_timestamp);
$end_timestamp = $now->add(new DateInterval("PT2H"));
$end_timestamp = $end_timestamp->format("Y-m-d H:i:s");
$this->view->shows = Show::getShows($today_timestamp, $end_timestamp, $excludeInstance=NULL, $onlyRecord=TRUE);
} }
public function uploadRecordedAction() public function uploadRecordedAction()
@ -276,9 +279,12 @@ class ApiController extends Zend_Controller_Action
$file = StoredFile::uploadFile($upload_dir); $file = StoredFile::uploadFile($upload_dir);
$show_instance = $this->_getParam('show_instance'); $show_instance = $this->_getParam('show_instance');
$show_inst = new ShowInstance($show_instance); $show_inst = new ShowInstance($show_instance);
$show_inst->setRecordedFile($file->getId()); $show_inst->setRecordedFile($file->getId());
$show_name = $show_inst->getName();
$show_genre = $show_inst->getGenre();
$show_start_time = $show_inst->getShowStart();
if(Application_Model_Preference::GetDoSoundCloudUpload()) if(Application_Model_Preference::GetDoSoundCloudUpload())
{ {
@ -288,9 +294,11 @@ class ApiController extends Zend_Controller_Action
$description = $show->getDescription(); $description = $show->getDescription();
$hosts = $show->getHosts(); $hosts = $show->getHosts();
$tags = array_merge($hosts, array($show_name));
try { try {
$soundcloud = new ATSoundcloud(); $soundcloud = new ATSoundcloud();
$soundcloud_id = $soundcloud->uploadTrack($file->getRealFilePath(), $file->getName(), $description, $hosts); $soundcloud_id = $soundcloud->uploadTrack($file->getRealFilePath(), $file->getName(), $description, $tags, $show_start_time, $show_genre);
$show_inst->setSoundCloudFileId($soundcloud_id); $show_inst->setSoundCloudFileId($soundcloud_id);
break; break;
} }

View File

@ -10,37 +10,37 @@ class PreferenceController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
$this->view->headScript()->appendFile('/js/airtime/preferences/preferences.js','text/javascript');
$request = $this->getRequest();
$this->view->statusMsg = ""; $this->view->statusMsg = "";
$form = new Application_Form_Preferences(); $form = new Application_Form_Preferences();
$this->view->form = $form;
} if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
public function updateAction() $values = $form->getValues();
{
$request = $this->getRequest();
if (!$this->getRequest()->isPost()) {
return $this->_forward('Preference/index');
}
$form = new Application_Form_Preferences(); Application_Model_Preference::SetHeadTitle($values["preferences_general"]["stationName"], $this->view);
if ($form->isValid($request->getPost())) { Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
Application_Model_Preference::SetStreamLabelFormat($values["preferences_general"]["streamFormat"]);
Application_Model_Preference::SetAllow3rdPartyApi($values["preferences_general"]["thirdPartyApi"]);
$values = $form->getValues(); Application_Model_Preference::SetDoSoundCloudUpload($values["preferences_soundcloud"]["UseSoundCloud"]);
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view); Application_Model_Preference::SetSoundCloudUser($values["preferences_soundcloud"]["SoundCloudUser"]);
Application_Model_Preference::SetDefaultFade($values["stationDefaultFade"]); Application_Model_Preference::SetSoundCloudPassword($values["preferences_soundcloud"]["SoundCloudPassword"]);
Application_Model_Preference::SetStreamLabelFormat($values["streamFormat"]); Application_Model_Preference::SetSoundCloudTags($values["preferences_soundcloud"]["SoundCloudTags"]);
Application_Model_Preference::SetAllow3rdPartyApi($values["thirdPartyApi"]); Application_Model_Preference::SetSoundCloudGenre($values["preferences_soundcloud"]["SoundCloudGenre"]);
Application_Model_Preference::SetDoSoundCloudUpload($values["UseSoundCloud"]); Application_Model_Preference::SetSoundCloudTrackType($values["preferences_soundcloud"]["SoundCloudTrackType"]);
Application_Model_Preference::SetSoundCloudUser($values["SoundCloudUser"]); Application_Model_Preference::SetSoundCloudLicense($values["preferences_soundcloud"]["SoundCloudLicense"]);
Application_Model_Preference::SetSoundCloudPassword($values["SoundCloudPassword"]);
Application_Model_Preference::SetSoundCloudTags($values["SoundCloudTags"]); $this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
}
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
} }
$this->view->form = $form; $this->view->form = $form;
return $this->render('index'); //render the phtml file
} }
} }

View File

@ -25,6 +25,7 @@ class ScheduleController extends Zend_Controller_Action
->addActionContext('edit-show', 'json') ->addActionContext('edit-show', 'json')
->addActionContext('add-show', 'json') ->addActionContext('add-show', 'json')
->addActionContext('cancel-show', 'json') ->addActionContext('cancel-show', 'json')
->addActionContext('upload-to-sound-cloud', 'json')
->initContext(); ->initContext();
$this->sched_sess = new Zend_Session_Namespace("schedule"); $this->sched_sess = new Zend_Session_Namespace("schedule");
@ -145,6 +146,52 @@ class ScheduleController extends Zend_Controller_Action
} }
} }
public function uploadToSoundCloudAction()
{
global $CC_CONFIG;
$show_instance = $this->_getParam('id');
$show_inst = new ShowInstance($show_instance);
$file = $show_inst->getRecordedFile();
if(is_null($file)) {
$this->view->error = "Recorded file does not exist";
return;
}
$show_name = $show_inst->getName();
$show_genre = $show_inst->getGenre();
$show_start_time = $show_inst->getShowStart();
if(Application_Model_Preference::GetDoSoundCloudUpload())
{
for($i=0; $i<$CC_CONFIG['soundcloud-connection-retries']; $i++) {
$show = new Show($show_inst->getShowId());
$description = $show->getDescription();
$hosts = $show->getHosts();
$tags = array_merge($hosts, array($show_name));
try {
$soundcloud = new ATSoundcloud();
$soundcloud_id = $soundcloud->uploadTrack($file->getRealFilePath(), $file->getName(), $description, $tags, $show_start_time, $show_genre);
$show_inst->setSoundCloudFileId($soundcloud_id);
$this->view->soundcloud_id = $soundcloud_id;
break;
}
catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
$code = $e->getHttpCode();
if(!in_array($code, array(0, 100))) {
break;
}
}
sleep($CC_CONFIG['soundcloud-connection-wait']);
}
}
}
public function makeContextMenuAction() public function makeContextMenuAction()
{ {
$id = $this->_getParam('id'); $id = $this->_getParam('id');
@ -174,10 +221,18 @@ class ScheduleController extends Zend_Controller_Action
'callback' => 'window["buildContentDialog"]'), 'title' => 'Show Content'); 'callback' => 'window["buildContentDialog"]'), 'title' => 'Show Content');
} }
if (strtotime($show->getShowEnd()) <= strtotime($today_timestamp)
&& is_null($show->getSoundCloudFileId())
&& Application_Model_Preference::GetDoSoundCloudUpload()) {
$menu[] = array('action' => array('type' => 'fn',
'callback' => "window['uploadToSoundCloud']($id)"),
'title' => 'Upload to Soundcloud');
}
if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) && if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) &&
strtotime($today_timestamp) < strtotime($show->getShowEnd()) && strtotime($today_timestamp) < strtotime($show->getShowEnd()) &&
$user->isAdmin()) { $user->isAdmin() && !$show->isRecorded()) {
$menu[] = array('action' => array('type' => 'fn', $menu[] = array('action' => array('type' => 'fn',
'callback' => "window['confirmCancelShow']($id)"), 'callback' => "window['confirmCancelShow']($id)"),
'title' => 'Cancel Current Show'); 'title' => 'Cancel Current Show');
@ -409,6 +464,9 @@ class ScheduleController extends Zend_Controller_Action
$rebroad = $formRebroadcast->checkReliantFields($data); $rebroad = $formRebroadcast->checkReliantFields($data);
} }
} }
else {
$rebroad = 1;
}
} }
else { else {
$formRebroadcast->reset(); $formRebroadcast->reset();
@ -422,6 +480,9 @@ class ScheduleController extends Zend_Controller_Action
$rebroadAb = $formAbsoluteRebroadcast->checkReliantFields($data); $rebroadAb = $formAbsoluteRebroadcast->checkReliantFields($data);
} }
} }
else {
$rebroadAb = 1;
}
} }
$who = $formWho->isValid($data); $who = $formWho->isValid($data);

View File

@ -165,7 +165,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
$show_end->add(new DateInterval("PT$duration[0]H")); $show_end->add(new DateInterval("PT$duration[0]H"));
$show_end->add(new DateInterval("PT$duration[1]M")); $show_end->add(new DateInterval("PT$duration[1]M"));
$show_end->add(new DateInterval("PT1H"));//min time to wait until a rebroadcast $show_end->add(new DateInterval("PT1H"));//min time to wait until a rebroadcast
$rebroad_start = $formData['add_show_start_date']."".$formData['add_show_rebroadcast_time_'.$i]; $rebroad_start = $formData['add_show_start_date']."".$formData['add_show_rebroadcast_time_'.$i];
$rebroad_start = new DateTime($rebroad_start); $rebroad_start = new DateTime($rebroad_start);

View File

@ -21,7 +21,15 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
'required' => false, 'required' => false,
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array('NotEmpty') 'validators' => array('NotEmpty')
)); ));
// Add genre element
$this->addElement('text', 'add_show_genre', array(
'label' => 'Genre:',
'class' => 'input_text',
'required' => false,
'filters' => array('StringTrim')
));
// Add the description element // Add the description element
$this->addElement('textarea', 'add_show_description', array( $this->addElement('textarea', 'add_show_description', array(

View File

@ -0,0 +1,65 @@
<?php
class Application_Form_GeneralPreferences extends Zend_Form_SubForm
{
public function init()
{
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))
));
//Station name
$this->addElement('text', 'stationName', array(
'class' => 'input_text',
'label' => 'Station Name:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array('NotEmpty'),
'value' => Application_Model_Preference::GetValue("station_name"),
'decorators' => array(
'ViewHelper'
)
));
$defaultFade = Application_Model_Preference::GetDefaultFade();
if($defaultFade == ""){
$defaultFade = '00:00:00.000000';
}
//Default station fade
$this->addElement('text', 'stationDefaultFade', array(
'class' => 'input_text',
'label' => 'Default Fade:',
'required' => false,
'filters' => array('StringTrim'),
'validators' => array(array('regex', false,
array('/^[0-2][0-3]:[0-5][0-9]:[0-5][0-9](\.\d{1,6})?$/',
'messages' => 'enter a time 00:00:00{.000000}'))),
'value' => $defaultFade,
'decorators' => array(
'ViewHelper'
)
));
$stream_format = new Zend_Form_Element_Radio('streamFormat');
$stream_format->setLabel('Stream Label:');
$stream_format->setMultiOptions(array("Artist - Title",
"Show - Artist - Title",
"Station name - Show name"));
$stream_format->setValue(Application_Model_Preference::GetStreamLabelFormat());
$stream_format->setDecorators(array('ViewHelper'));
$this->addElement($stream_format);
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
$third_party_api->setLabel('Allow Remote Websites To Access Show Schedule Info');
$third_party_api->setMultiOptions(array("Disabled",
"Enabled"));
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
$third_party_api->setDecorators(array('ViewHelper'));
$this->addElement($third_party_api);
}
}

View File

@ -5,90 +5,26 @@ class Application_Form_Preferences extends Zend_Form
public function init() public function init()
{ {
$this->setAction('/Preference/update')->setMethod('post'); $this->setAction('/Preference');
$this->setMethod('post');
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/preferences.phtml'))
));
//Station name $general_pref = new Application_Form_GeneralPreferences();
$this->addElement('text', 'stationName', array( $this->addSubForm($general_pref, 'preferences_general');
'class' => 'input_text',
'label' => 'Station Name:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array('NotEmpty'),
'value' => Application_Model_Preference::GetValue("station_name")
));
$defaultFade = Application_Model_Preference::GetDefaultFade(); $soundcloud_pref = new Application_Form_SoundcloudPreferences();
if($defaultFade == ""){ $this->addSubForm($soundcloud_pref, 'preferences_soundcloud');
$defaultFade = '00:00:00.000000';
}
//Default station fade
$this->addElement('text', 'stationDefaultFade', array(
'class' => 'input_text',
'label' => 'Default Fade:',
'required' => false,
'filters' => array('StringTrim'),
'validators' => array(array('regex', false,
array('/^[0-2][0-3]:[0-5][0-9]:[0-5][0-9](\.\d{1,6})?$/',
'messages' => 'enter a time 00:00:00{.000000}'))),
'value' => $defaultFade
));
$stream_format = new Zend_Form_Element_Radio('streamFormat');
$stream_format->setLabel('Stream Label:');
$stream_format->setMultiOptions(array("Artist - Title",
"Show - Artist - Title",
"Station name - Show name"));
$stream_format->setValue(Application_Model_Preference::GetStreamLabelFormat());
$this->addElement($stream_format);
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
$third_party_api->setLabel('Allow Remote Websites To Access Show Schedule Info');
$third_party_api->setMultiOptions(array("Disabled",
"Enabled"));
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
$this->addElement($third_party_api);
$this->addElement('checkbox', 'UseSoundCloud', array(
'label' => 'Automatically Upload Recorded Shows To SoundCloud',
'required' => false,
'value' => Application_Model_Preference::GetDoSoundCloudUpload()
));
//SoundCloud Username
$this->addElement('text', 'SoundCloudUser', array(
'class' => 'input_text',
'label' => 'SoundCloud Email:',
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetSoundCloudUser()
));
//SoundCloud Password
$this->addElement('password', 'SoundCloudPassword', array(
'class' => 'input_text',
'label' => 'SoundCloud Password:',
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetSoundCloudPassword()
));
// Add the description element
$this->addElement('textarea', 'SoundCloudTags', array(
'label' => 'space separated SoundCloud Tags',
'required' => false,
'class' => 'input_text_area',
'value' => Application_Model_Preference::GetSoundCloudTags()
));
$this->addElement('submit', 'submit', array( $this->addElement('submit', 'submit', array(
'class' => 'ui-button ui-state-default', 'class' => 'ui-button ui-state-default right-floated',
'ignore' => true, 'ignore' => true,
'label' => 'Submit', 'label' => 'Submit',
)); 'decorators' => array(
'ViewHelper'
)
));
} }
} }

View File

@ -0,0 +1,115 @@
<?php
class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
{
public function init()
{
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/preferences_soundcloud.phtml'))
));
//enable soundcloud uploads
$this->addElement('checkbox', 'UseSoundCloud', array(
'label' => 'Upload Recorded Shows To SoundCloud',
'required' => false,
'value' => Application_Model_Preference::GetDoSoundCloudUpload(),
'decorators' => array(
'ViewHelper'
)
));
//SoundCloud Username
$this->addElement('text', 'SoundCloudUser', array(
'class' => 'input_text',
'label' => 'SoundCloud Email:',
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetSoundCloudUser(),
'decorators' => array(
'ViewHelper'
)
));
//SoundCloud Password
$this->addElement('password', 'SoundCloudPassword', array(
'class' => 'input_text',
'label' => 'SoundCloud Password:',
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetSoundCloudPassword(),
'decorators' => array(
'ViewHelper'
)
));
// Add the description element
$this->addElement('textarea', 'SoundCloudTags', array(
'label' => 'space separated SoundCloud Tags',
'required' => false,
'class' => 'input_text_area',
'value' => Application_Model_Preference::GetSoundCloudTags(),
'decorators' => array(
'ViewHelper'
)
));
//SoundCloud default genre
$this->addElement('text', 'SoundCloudGenre', array(
'class' => 'input_text',
'label' => 'Default Genre:',
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetSoundCloudGenre(),
'decorators' => array(
'ViewHelper'
)
));
$select = new Zend_Form_Element_Select('SoundCloudTrackType');
$select->setLabel('Default Track Type:');
$select->setAttrib('class', 'input_select');
$select->setMultiOptions(array(
"" => "",
"original" => "Original",
"remix" => "Remix",
"live" => "Live",
"recording" => "Recording",
"spoken" => "Spoken",
"podcast" => "Podcast",
"demo" => "Demo",
"in progress" => "Work in progress",
"stem" => "Stem",
"loop" => "Loop",
"sound effect" => "Sound Effect",
"sample" => "One Shot Sample",
"other" => "Other"
));
$select->setRequired(false);
$select->setValue(Application_Model_Preference::GetSoundCloudTrackType());
$select->setDecorators(array('ViewHelper'));
$this->addElement($select);
$select = new Zend_Form_Element_Select('SoundCloudLicense');
$select->setLabel('Default License:');
$select->setAttrib('class', 'input_select');
$select->setMultiOptions(array(
"" => "",
"no-rights-reserved" => "The work is in the public domain",
"all-rights-reserved" => "All rights are reserved",
"cc-by" => "Creative Commons Attribution",
"cc-by-nc" => "Creative Commons Attribution Noncommercial",
"cc-by-nd" => "Creative Commons Attribution No Derivative Works",
"cc-by-sa" => "Creative Commons Attribution Share Alike",
"cc-by-nc-nd" => "Creative Commons Attribution Noncommercial Non Derivate Works",
"cc-by-nc-sa" => "Creative Commons Attribution Noncommercial Share Alike"
));
$select->setRequired(false);
$select->setValue(Application_Model_Preference::GetSoundCloudLicense());
$select->setDecorators(array('ViewHelper'));
$this->addElement($select);
}
}

View File

@ -6,19 +6,38 @@ class Application_Model_Preference
public static function SetValue($key, $value){ public static function SetValue($key, $value){
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
$auth = Zend_Auth::getInstance(); //called from a daemon process
$id = $auth->getIdentity()->id; if(!Zend_Auth::getInstance()->hasIdentity()) {
$id = NULL;
}
else {
$auth = Zend_Auth::getInstance();
$id = $auth->getIdentity()->id;
}
$key = pg_escape_string($key);
$value = pg_escape_string($value);
//Check if key already exists //Check if key already exists
$sql = "SELECT COUNT(*) FROM cc_pref" $sql = "SELECT COUNT(*) FROM cc_pref"
." WHERE keystr = '$key'"; ." WHERE keystr = '$key'";
$result = $CC_DBC->GetOne($sql); $result = $CC_DBC->GetOne($sql);
if ($result == 1){ if ($result == 1 && is_null($id)){
$sql = "UPDATE cc_pref"
." SET subjid = NULL, valstr = '$value'"
." WHERE keystr = '$key'";
}
else if ($result == 1 && !is_null($id)){
$sql = "UPDATE cc_pref" $sql = "UPDATE cc_pref"
." SET subjid = $id, valstr = '$value'" ." SET subjid = $id, valstr = '$value'"
." WHERE keystr = '$key'"; ." WHERE keystr = '$key'";
} else { }
else if(is_null($id)) {
$sql = "INSERT INTO cc_pref (keystr, valstr)"
." VALUES ('$key', '$value')";
}
else {
$sql = "INSERT INTO cc_pref (subjid, keystr, valstr)" $sql = "INSERT INTO cc_pref (subjid, keystr, valstr)"
." VALUES ($id, '$key', '$value')"; ." VALUES ($id, '$key', '$value')";
} }
@ -133,6 +152,30 @@ class Application_Model_Preference
return Application_Model_Preference::GetValue("soundcloud_tags"); return Application_Model_Preference::GetValue("soundcloud_tags");
} }
public static function SetSoundCloudGenre($genre) {
Application_Model_Preference::SetValue("soundcloud_genre", $genre);
}
public static function GetSoundCloudGenre() {
return Application_Model_Preference::GetValue("soundcloud_genre");
}
public static function SetSoundCloudTrackType($track_type) {
Application_Model_Preference::SetValue("soundcloud_tracktype", $track_type);
}
public static function GetSoundCloudTrackType() {
return Application_Model_Preference::GetValue("soundcloud_tracktype");
}
public static function SetSoundCloudLicense($license) {
Application_Model_Preference::SetValue("soundcloud_license", $license);
}
public static function GetSoundCloudLicense() {
return Application_Model_Preference::GetValue("soundcloud_license");
}
public static function SetAllow3rdPartyApi($bool) { public static function SetAllow3rdPartyApi($bool) {
Application_Model_Preference::SetValue("third_party_api", $bool); Application_Model_Preference::SetValue("third_party_api", $bool);
} }

View File

@ -155,6 +155,7 @@ class Show {
$show->setDbName($data['add_show_name']); $show->setDbName($data['add_show_name']);
$show->setDbDescription($data['add_show_description']); $show->setDbDescription($data['add_show_description']);
$show->setDbUrl($data['add_show_url']); $show->setDbUrl($data['add_show_url']);
$show->setDbGenre($data['add_show_genre']);
$show->setDbColor($data['add_show_color']); $show->setDbColor($data['add_show_color']);
$show->setDbBackgroundColor($data['add_show_background_color']); $show->setDbBackgroundColor($data['add_show_background_color']);
$show->save(); $show->save();
@ -274,6 +275,14 @@ class Show {
{ {
global $CC_DBC; global $CC_DBC;
$showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil();
//if application is requesting shows past our previous populated until date, generate shows up until this point.
if ($showsPopUntil == "" || strtotime($showsPopUntil) < strtotime($end_timestamp)) {
Show::populateAllShowsInRange($showsPopUntil, $end_timestamp);
Application_Model_Preference::SetShowsPopulatedUntil($end_timestamp);
}
$sql = "SELECT starts, ends, record, rebroadcast, soundcloud_id, instance_id, show_id, name, description, $sql = "SELECT starts, ends, record, rebroadcast, soundcloud_id, instance_id, show_id, name, description,
color, background_color, cc_show_instances.id AS instance_id color, background_color, cc_show_instances.id AS instance_id
FROM cc_show_instances FROM cc_show_instances
@ -282,7 +291,7 @@ class Show {
//only want shows that are starting at the time or later. //only want shows that are starting at the time or later.
if ($onlyRecord) { if ($onlyRecord) {
$sql = $sql." WHERE (starts >= '{$start_timestamp}' AND starts < timestamp '{$start_timestamp}' + interval '2 hours')"; $sql = $sql." WHERE (starts >= '{$start_timestamp}' AND starts < timestamp '{$end_timestamp}')";
$sql = $sql." AND (record = 1)"; $sql = $sql." AND (record = 1)";
} }
else { else {
@ -524,13 +533,6 @@ class Show {
public static function getFullCalendarEvents($start, $end, $editable=false) public static function getFullCalendarEvents($start, $end, $editable=false)
{ {
$events = array(); $events = array();
$showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil();
//if fullcalendar is requesting shows past our previous populated until date, generate shows up until this point.
if ($showsPopUntil == "" || strtotime($showsPopUntil) < strtotime($end)) {
Show::populateAllShowsInRange($showsPopUntil, $end);
Application_Model_Preference::SetShowsPopulatedUntil($end);
}
$shows = Show::getShows($start, $end); $shows = Show::getShows($start, $end);
@ -616,6 +618,12 @@ class ShowInstance {
return $show->getDbName(); return $show->getDbName();
} }
public function getGenre()
{
$show = CcShowQuery::create()->findPK($this->getShowId());
return $show->getDbGenre();
}
public function getShowStart() public function getShowStart()
{ {
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId); $showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
@ -641,6 +649,26 @@ class ShowInstance {
return $showInstance->getDbSoundCloudId(); return $showInstance->getDbSoundCloudId();
} }
public function getRecordedFile()
{
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
$file_id = $showInstance->getDbRecordedFile();
if(isset($file_id)) {
$file = StoredFile::Recall($file_id);
if (PEAR::isError($file)) {
return null;
}
if(file_exists($file->getRealFilePath())) {
return $file;
}
}
return null;
}
public function setShowStart($start) public function setShowStart($start)
{ {
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId); $showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);

View File

@ -28,7 +28,7 @@ class ATSoundcloud {
return $token; return $token;
} }
public function uploadTrack($filepath, $filename, $description, $tags=array()) public function uploadTrack($filepath, $filename, $description, $tags=array(), $release=null, $genre=null)
{ {
if($this->getToken()) if($this->getToken())
{ {
@ -50,6 +50,38 @@ class ATSoundcloud {
); );
if(isset($release)) {
$release = str_replace(" ", "-", $release);
$release = str_replace(":", "-", $release);
//YYYY-MM-DD-HH-mm-SS
$release = explode("-", $release);
$track_data['track[release_year]'] = $release[0];
$track_data['track[release_month]'] = $release[1];
$track_data['track[release_day]'] = $release[2];
}
if (isset($genre) && $genre != "") {
$track_data['track[genre]'] = $genre;
}
else {
$default_genre = Application_Model_Preference::GetSoundCloudTrackType();
if ($genre != "") {
$track_data['track[genre]'] = $default_genre;
}
}
$track_type = Application_Model_Preference::GetSoundCloudTrackType();
if ($track_type != "") {
$track_data['track[track_type]'] = $track_type;
}
$license = Application_Model_Preference::GetSoundCloudLicense();
if ($license != "") {
$track_data['track[license]'] = $license;
}
$response = json_decode( $response = json_decode(
$this->_soundcloud->post('tracks', $track_data), $this->_soundcloud->post('tracks', $track_data),
true true

View File

@ -41,6 +41,7 @@ class CcShowTableMap extends TableMap {
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, ''); $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
$this->addColumn('URL', 'DbUrl', 'VARCHAR', false, 255, ''); $this->addColumn('URL', 'DbUrl', 'VARCHAR', false, 255, '');
$this->addColumn('GENRE', 'DbGenre', 'VARCHAR', false, 255, '');
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null); $this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
$this->addColumn('COLOR', 'DbColor', 'VARCHAR', false, 6, null); $this->addColumn('COLOR', 'DbColor', 'VARCHAR', false, 6, null);
$this->addColumn('BACKGROUND_COLOR', 'DbBackgroundColor', 'VARCHAR', false, 6, null); $this->addColumn('BACKGROUND_COLOR', 'DbBackgroundColor', 'VARCHAR', false, 6, null);

View File

@ -44,6 +44,13 @@ abstract class BaseCcShow extends BaseObject implements Persistent
*/ */
protected $url; protected $url;
/**
* The value for the genre field.
* Note: this column has a database default value of: ''
* @var string
*/
protected $genre;
/** /**
* The value for the description field. * The value for the description field.
* @var string * @var string
@ -106,6 +113,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent
{ {
$this->name = ''; $this->name = '';
$this->url = ''; $this->url = '';
$this->genre = '';
} }
/** /**
@ -148,6 +156,16 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this->url; return $this->url;
} }
/**
* Get the [genre] column value.
*
* @return string
*/
public function getDbGenre()
{
return $this->genre;
}
/** /**
* Get the [description] column value. * Get the [description] column value.
* *
@ -238,6 +256,26 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this; return $this;
} // setDbUrl() } // setDbUrl()
/**
* Set the value of [genre] column.
*
* @param string $v new value
* @return CcShow The current object (for fluent API support)
*/
public function setDbGenre($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->genre !== $v || $this->isNew()) {
$this->genre = $v;
$this->modifiedColumns[] = CcShowPeer::GENRE;
}
return $this;
} // setDbGenre()
/** /**
* Set the value of [description] column. * Set the value of [description] column.
* *
@ -316,6 +354,10 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return false; return false;
} }
if ($this->genre !== '') {
return false;
}
// otherwise, everything was equal, so return TRUE // otherwise, everything was equal, so return TRUE
return true; return true;
} // hasOnlyDefaultValues() } // hasOnlyDefaultValues()
@ -341,9 +383,10 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; $this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->url = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; $this->url = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->description = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; $this->genre = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->color = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; $this->description = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->background_color = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; $this->color = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
$this->background_color = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
$this->resetModified(); $this->resetModified();
$this->setNew(false); $this->setNew(false);
@ -352,7 +395,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->ensureConsistency(); $this->ensureConsistency();
} }
return $startcol + 6; // 6 = CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS). return $startcol + 7; // 7 = CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating CcShow object", $e); throw new PropelException("Error populating CcShow object", $e);
@ -733,12 +776,15 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this->getDbUrl(); return $this->getDbUrl();
break; break;
case 3: case 3:
return $this->getDbDescription(); return $this->getDbGenre();
break; break;
case 4: case 4:
return $this->getDbColor(); return $this->getDbDescription();
break; break;
case 5: case 5:
return $this->getDbColor();
break;
case 6:
return $this->getDbBackgroundColor(); return $this->getDbBackgroundColor();
break; break;
default: default:
@ -767,9 +813,10 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$keys[0] => $this->getDbId(), $keys[0] => $this->getDbId(),
$keys[1] => $this->getDbName(), $keys[1] => $this->getDbName(),
$keys[2] => $this->getDbUrl(), $keys[2] => $this->getDbUrl(),
$keys[3] => $this->getDbDescription(), $keys[3] => $this->getDbGenre(),
$keys[4] => $this->getDbColor(), $keys[4] => $this->getDbDescription(),
$keys[5] => $this->getDbBackgroundColor(), $keys[5] => $this->getDbColor(),
$keys[6] => $this->getDbBackgroundColor(),
); );
return $result; return $result;
} }
@ -811,12 +858,15 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->setDbUrl($value); $this->setDbUrl($value);
break; break;
case 3: case 3:
$this->setDbDescription($value); $this->setDbGenre($value);
break; break;
case 4: case 4:
$this->setDbColor($value); $this->setDbDescription($value);
break; break;
case 5: case 5:
$this->setDbColor($value);
break;
case 6:
$this->setDbBackgroundColor($value); $this->setDbBackgroundColor($value);
break; break;
} // switch() } // switch()
@ -846,9 +896,10 @@ abstract class BaseCcShow extends BaseObject implements Persistent
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]); if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbUrl($arr[$keys[2]]); if (array_key_exists($keys[2], $arr)) $this->setDbUrl($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbDescription($arr[$keys[3]]); if (array_key_exists($keys[3], $arr)) $this->setDbGenre($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbColor($arr[$keys[4]]); if (array_key_exists($keys[4], $arr)) $this->setDbDescription($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbBackgroundColor($arr[$keys[5]]); if (array_key_exists($keys[5], $arr)) $this->setDbColor($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDbBackgroundColor($arr[$keys[6]]);
} }
/** /**
@ -863,6 +914,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent
if ($this->isColumnModified(CcShowPeer::ID)) $criteria->add(CcShowPeer::ID, $this->id); if ($this->isColumnModified(CcShowPeer::ID)) $criteria->add(CcShowPeer::ID, $this->id);
if ($this->isColumnModified(CcShowPeer::NAME)) $criteria->add(CcShowPeer::NAME, $this->name); if ($this->isColumnModified(CcShowPeer::NAME)) $criteria->add(CcShowPeer::NAME, $this->name);
if ($this->isColumnModified(CcShowPeer::URL)) $criteria->add(CcShowPeer::URL, $this->url); if ($this->isColumnModified(CcShowPeer::URL)) $criteria->add(CcShowPeer::URL, $this->url);
if ($this->isColumnModified(CcShowPeer::GENRE)) $criteria->add(CcShowPeer::GENRE, $this->genre);
if ($this->isColumnModified(CcShowPeer::DESCRIPTION)) $criteria->add(CcShowPeer::DESCRIPTION, $this->description); if ($this->isColumnModified(CcShowPeer::DESCRIPTION)) $criteria->add(CcShowPeer::DESCRIPTION, $this->description);
if ($this->isColumnModified(CcShowPeer::COLOR)) $criteria->add(CcShowPeer::COLOR, $this->color); if ($this->isColumnModified(CcShowPeer::COLOR)) $criteria->add(CcShowPeer::COLOR, $this->color);
if ($this->isColumnModified(CcShowPeer::BACKGROUND_COLOR)) $criteria->add(CcShowPeer::BACKGROUND_COLOR, $this->background_color); if ($this->isColumnModified(CcShowPeer::BACKGROUND_COLOR)) $criteria->add(CcShowPeer::BACKGROUND_COLOR, $this->background_color);
@ -929,6 +981,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent
{ {
$copyObj->setDbName($this->name); $copyObj->setDbName($this->name);
$copyObj->setDbUrl($this->url); $copyObj->setDbUrl($this->url);
$copyObj->setDbGenre($this->genre);
$copyObj->setDbDescription($this->description); $copyObj->setDbDescription($this->description);
$copyObj->setDbColor($this->color); $copyObj->setDbColor($this->color);
$copyObj->setDbBackgroundColor($this->background_color); $copyObj->setDbBackgroundColor($this->background_color);
@ -1526,6 +1579,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->id = null; $this->id = null;
$this->name = null; $this->name = null;
$this->url = null; $this->url = null;
$this->genre = null;
$this->description = null; $this->description = null;
$this->color = null; $this->color = null;
$this->background_color = null; $this->background_color = null;

View File

@ -26,7 +26,7 @@ abstract class BaseCcShowPeer {
const TM_CLASS = 'CcShowTableMap'; const TM_CLASS = 'CcShowTableMap';
/** The total number of columns. */ /** The total number of columns. */
const NUM_COLUMNS = 6; const NUM_COLUMNS = 7;
/** The number of lazy-loaded columns. */ /** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0; const NUM_LAZY_LOAD_COLUMNS = 0;
@ -40,6 +40,9 @@ abstract class BaseCcShowPeer {
/** the column name for the URL field */ /** the column name for the URL field */
const URL = 'cc_show.URL'; const URL = 'cc_show.URL';
/** the column name for the GENRE field */
const GENRE = 'cc_show.GENRE';
/** the column name for the DESCRIPTION field */ /** the column name for the DESCRIPTION field */
const DESCRIPTION = 'cc_show.DESCRIPTION'; const DESCRIPTION = 'cc_show.DESCRIPTION';
@ -65,12 +68,12 @@ abstract class BaseCcShowPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
private static $fieldNames = array ( private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbUrl', 'DbDescription', 'DbColor', 'DbBackgroundColor', ), BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbDescription', 'dbColor', 'dbBackgroundColor', ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::URL, self::DESCRIPTION, self::COLOR, self::BACKGROUND_COLOR, ), BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::URL, self::GENRE, self::DESCRIPTION, self::COLOR, self::BACKGROUND_COLOR, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', ), BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'description', 'color', 'background_color', ), BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
); );
/** /**
@ -80,12 +83,12 @@ abstract class BaseCcShowPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/ */
private static $fieldKeys = array ( private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbUrl' => 2, 'DbDescription' => 3, 'DbColor' => 4, 'DbBackgroundColor' => 5, ), BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbUrl' => 2, 'DbGenre' => 3, 'DbDescription' => 4, 'DbColor' => 5, 'DbBackgroundColor' => 6, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbDescription' => 3, 'dbColor' => 4, 'dbBackgroundColor' => 5, ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbGenre' => 3, 'dbDescription' => 4, 'dbColor' => 5, 'dbBackgroundColor' => 6, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::URL => 2, self::DESCRIPTION => 3, self::COLOR => 4, self::BACKGROUND_COLOR => 5, ), BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::URL => 2, self::GENRE => 3, self::DESCRIPTION => 4, self::COLOR => 5, self::BACKGROUND_COLOR => 6, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'DESCRIPTION' => 3, 'COLOR' => 4, 'BACKGROUND_COLOR' => 5, ), BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'description' => 3, 'color' => 4, 'background_color' => 5, ), BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
); );
/** /**
@ -160,6 +163,7 @@ abstract class BaseCcShowPeer {
$criteria->addSelectColumn(CcShowPeer::ID); $criteria->addSelectColumn(CcShowPeer::ID);
$criteria->addSelectColumn(CcShowPeer::NAME); $criteria->addSelectColumn(CcShowPeer::NAME);
$criteria->addSelectColumn(CcShowPeer::URL); $criteria->addSelectColumn(CcShowPeer::URL);
$criteria->addSelectColumn(CcShowPeer::GENRE);
$criteria->addSelectColumn(CcShowPeer::DESCRIPTION); $criteria->addSelectColumn(CcShowPeer::DESCRIPTION);
$criteria->addSelectColumn(CcShowPeer::COLOR); $criteria->addSelectColumn(CcShowPeer::COLOR);
$criteria->addSelectColumn(CcShowPeer::BACKGROUND_COLOR); $criteria->addSelectColumn(CcShowPeer::BACKGROUND_COLOR);
@ -167,6 +171,7 @@ abstract class BaseCcShowPeer {
$criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.NAME'); $criteria->addSelectColumn($alias . '.NAME');
$criteria->addSelectColumn($alias . '.URL'); $criteria->addSelectColumn($alias . '.URL');
$criteria->addSelectColumn($alias . '.GENRE');
$criteria->addSelectColumn($alias . '.DESCRIPTION'); $criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.COLOR'); $criteria->addSelectColumn($alias . '.COLOR');
$criteria->addSelectColumn($alias . '.BACKGROUND_COLOR'); $criteria->addSelectColumn($alias . '.BACKGROUND_COLOR');

View File

@ -9,6 +9,7 @@
* @method CcShowQuery orderByDbId($order = Criteria::ASC) Order by the id column * @method CcShowQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method CcShowQuery orderByDbName($order = Criteria::ASC) Order by the name column * @method CcShowQuery orderByDbName($order = Criteria::ASC) Order by the name column
* @method CcShowQuery orderByDbUrl($order = Criteria::ASC) Order by the url column * @method CcShowQuery orderByDbUrl($order = Criteria::ASC) Order by the url column
* @method CcShowQuery orderByDbGenre($order = Criteria::ASC) Order by the genre column
* @method CcShowQuery orderByDbDescription($order = Criteria::ASC) Order by the description column * @method CcShowQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
* @method CcShowQuery orderByDbColor($order = Criteria::ASC) Order by the color column * @method CcShowQuery orderByDbColor($order = Criteria::ASC) Order by the color column
* @method CcShowQuery orderByDbBackgroundColor($order = Criteria::ASC) Order by the background_color column * @method CcShowQuery orderByDbBackgroundColor($order = Criteria::ASC) Order by the background_color column
@ -16,6 +17,7 @@
* @method CcShowQuery groupByDbId() Group by the id column * @method CcShowQuery groupByDbId() Group by the id column
* @method CcShowQuery groupByDbName() Group by the name column * @method CcShowQuery groupByDbName() Group by the name column
* @method CcShowQuery groupByDbUrl() Group by the url column * @method CcShowQuery groupByDbUrl() Group by the url column
* @method CcShowQuery groupByDbGenre() Group by the genre column
* @method CcShowQuery groupByDbDescription() Group by the description column * @method CcShowQuery groupByDbDescription() Group by the description column
* @method CcShowQuery groupByDbColor() Group by the color column * @method CcShowQuery groupByDbColor() Group by the color column
* @method CcShowQuery groupByDbBackgroundColor() Group by the background_color column * @method CcShowQuery groupByDbBackgroundColor() Group by the background_color column
@ -46,6 +48,7 @@
* @method CcShow findOneByDbId(int $id) Return the first CcShow filtered by the id column * @method CcShow findOneByDbId(int $id) Return the first CcShow filtered by the id column
* @method CcShow findOneByDbName(string $name) Return the first CcShow filtered by the name column * @method CcShow findOneByDbName(string $name) Return the first CcShow filtered by the name column
* @method CcShow findOneByDbUrl(string $url) Return the first CcShow filtered by the url column * @method CcShow findOneByDbUrl(string $url) Return the first CcShow filtered by the url column
* @method CcShow findOneByDbGenre(string $genre) Return the first CcShow filtered by the genre column
* @method CcShow findOneByDbDescription(string $description) Return the first CcShow filtered by the description column * @method CcShow findOneByDbDescription(string $description) Return the first CcShow filtered by the description column
* @method CcShow findOneByDbColor(string $color) Return the first CcShow filtered by the color column * @method CcShow findOneByDbColor(string $color) Return the first CcShow filtered by the color column
* @method CcShow findOneByDbBackgroundColor(string $background_color) Return the first CcShow filtered by the background_color column * @method CcShow findOneByDbBackgroundColor(string $background_color) Return the first CcShow filtered by the background_color column
@ -53,6 +56,7 @@
* @method array findByDbId(int $id) Return CcShow objects filtered by the id column * @method array findByDbId(int $id) Return CcShow objects filtered by the id column
* @method array findByDbName(string $name) Return CcShow objects filtered by the name column * @method array findByDbName(string $name) Return CcShow objects filtered by the name column
* @method array findByDbUrl(string $url) Return CcShow objects filtered by the url column * @method array findByDbUrl(string $url) Return CcShow objects filtered by the url column
* @method array findByDbGenre(string $genre) Return CcShow objects filtered by the genre column
* @method array findByDbDescription(string $description) Return CcShow objects filtered by the description column * @method array findByDbDescription(string $description) Return CcShow objects filtered by the description column
* @method array findByDbColor(string $color) Return CcShow objects filtered by the color column * @method array findByDbColor(string $color) Return CcShow objects filtered by the color column
* @method array findByDbBackgroundColor(string $background_color) Return CcShow objects filtered by the background_color column * @method array findByDbBackgroundColor(string $background_color) Return CcShow objects filtered by the background_color column
@ -226,6 +230,28 @@ abstract class BaseCcShowQuery extends ModelCriteria
return $this->addUsingAlias(CcShowPeer::URL, $dbUrl, $comparison); return $this->addUsingAlias(CcShowPeer::URL, $dbUrl, $comparison);
} }
/**
* Filter the query on the genre column
*
* @param string $dbGenre The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowQuery The current query, for fluid interface
*/
public function filterByDbGenre($dbGenre = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbGenre)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbGenre)) {
$dbGenre = str_replace('*', '%', $dbGenre);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcShowPeer::GENRE, $dbGenre, $comparison);
}
/** /**
* Filter the query on the description column * Filter the query on the description column
* *

View File

@ -0,0 +1,14 @@
<form method="<?php echo $this->element->getMethod() ?>" action="<?php echo $this->element->getAction() ?>" enctype="application/x-www-form-urlencoded">
<?php echo $this->element->getSubform('preferences_general') ?>
<h3 class="collapsible-header"><span class="arrow-icon"></span>SoundCloud settings</h3>
<div class="collapsible-content" id="soundcloud-settings" style="display: none;">
<?php echo $this->element->getSubform('preferences_soundcloud') ?>
</div>
<div class="button-bar bottom" id="submit-element">
<?php echo $this->element->getElement('submit') ?>
</div>
</form>

View File

@ -0,0 +1,78 @@
<fieldset class="padded">
<dl class="zend_form">
<dt id="stationName-label" class="block-display">
<label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?></label>
</dt>
<dd id="stationName-element" class="block-display">
<?php echo $this->element->getElement('stationName') ?>
<?php if($this->element->getElement('stationName')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('stationName')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="stationDefaultFade-label" class="block-display">
<label class="optional" for="stationDefaultFade"><?php echo $this->element->getElement('stationDefaultFade')->getLabel() ?></label>
</dt>
<dd id="stationDefaultFade-element" class="block-display">
<?php echo $this->element->getElement('stationDefaultFade') ?>
<?php if($this->element->getElement('stationDefaultFade')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('stationDefaultFade')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="streamFormat-label" class="block-display">
<label class="optional"><?php echo $this->element->getElement('streamFormat')->getLabel() ?></label>
</dt>
<dd id="streamFormat-element" class="block-display radio-inline-list">
<?php $i=0;
$value = $this->element->getElement('streamFormat')->getValue();
?>
<?php foreach ($this->element->getElement('streamFormat')->getMultiOptions() as $radio) : ?>
<label for="streamFormat-<?php echo $i ?>">
<input type="radio" value="<?php echo $i ?>" id="streamFormat-<?php echo $i ?>" name="streamFormat" <?php if($i == $value){echo 'checked="checked"';}?>/>
<?php echo $radio ?>
</input>
</label>
<?php $i = $i + 1; ?>
<?php endforeach; ?>
<?php if($this->element->getElement('streamFormat')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('streamFormat')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="thirdPartyApi-label" class="block-display">
<label class="optional"><?php echo $this->element->getElement('thirdPartyApi')->getLabel() ?></label>
</dt>
<dd id="thirdPartyApi-element" class="block-display radio-inline-list">
<?php $i=0;
$value = $this->element->getElement('thirdPartyApi')->getValue();
?>
<?php foreach ($this->element->getElement('thirdPartyApi')->getMultiOptions() as $radio) : ?>
<label for="thirdPartyApi-<?php echo $i ?>">
<input type="radio" value="<?php echo $i ?>" id="thirdPartyApi-<?php echo $i ?>" name="thirdPartyApi" <?php if($i == $value){echo 'checked="checked"';}?> />
<?php echo $radio ?>
</input>
</label>
<?php $i = $i + 1; ?>
<?php endforeach; ?>
<?php if($this->element->getElement('thirdPartyApi')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('thirdPartyApi')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
</dl>
</fieldset>

View File

@ -0,0 +1,95 @@
<fieldset class="padded">
<dl class="zend_form">
<dd id="UseSoundCloud-element" class="block-display" style=" margin:6px 0 10px 0">
<label class="optional" for="UseSoundCloud">
<?php echo $this->element->getElement('UseSoundCloud') ?>
<strong><?php echo $this->element->getElement('UseSoundCloud')->getLabel() ?></strong>
</label>
<?php if($this->element->getElement('UseSoundCloud')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('UseSoundCloud')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="SoundCloudUser-label" class="block-display">
<label class="optional" for="SoundCloudUser"><?php echo $this->element->getElement('SoundCloudUser')->getLabel() ?></label>
</dt>
<dd id="SoundCloudUser-element" class="block-display">
<?php echo $this->element->getElement('SoundCloudUser') ?>
<?php if($this->element->getElement('SoundCloudUser')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('SoundCloudUser')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="SoundCloudPassword-label" class="block-display">
<label class="optional" for="SoundCloudPassword"><?php echo $this->element->getElement('SoundCloudPassword')->getLabel() ?></label>
</dt>
<dd id="SoundCloudPassword-element" class="block-display">
<?php echo $this->element->getElement('SoundCloudPassword') ?>
<?php if($this->element->getElement('SoundCloudPassword')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('SoundCloudPassword')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="SoundCloudTags-label" class="block-display">
<label class="optional" for="SoundCloudTags"><?php echo $this->element->getElement('SoundCloudTags')->getLabel() ?></label>
</dt>
<dd id="SoundCloudTags-element" class="block-display clearfix">
<?php echo $this->element->getElement('SoundCloudTags') ?>
<?php if($this->element->getElement('SoundCloudTags')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('SoundCloudTags')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="SoundCloudGenre-label" class="block-display">
<label class="optional" for="SoundCloudGenre"><?php echo $this->element->getElement('SoundCloudGenre')->getLabel() ?></label>
</dt>
<dd id="SoundCloudGenre-element" class="block-display">
<?php echo $this->element->getElement('SoundCloudGenre') ?>
<?php if($this->element->getElement('SoundCloudGenre')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('SoundCloudGenre')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="SoundCloudTrackType-label" class="block-display">
<label class="optional" for="SoundCloudTrackType"><?php echo $this->element->getElement('SoundCloudTrackType')->getLabel() ?></label>
</dt>
<dd id="SoundCloudTrackType-element" class="block-display">
<?php echo $this->element->getElement('SoundCloudTrackType') ?>
<?php if($this->element->getElement('SoundCloudTrackType')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('SoundCloudTrackType')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="SoundCloudLicense-label" class="block-display">
<label class="optional" for="SoundCloudLicense"><?php echo $this->element->getElement('SoundCloudLicense')->getLabel() ?></label>
</dt>
<dd id="SoundCloudLicense-element" class="block-display">
<?php echo $this->element->getElement('SoundCloudLicense') ?>
<?php if($this->element->getElement('SoundCloudLicense')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('SoundCloudLicense')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
</dl>
</fieldset>

View File

@ -1,4 +1,5 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong"> <div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences">
<h2>Preferences</h2>
<?php <?php
echo $this->statusMsg; echo $this->statusMsg;
echo $this->form; echo $this->form;

View File

@ -1 +0,0 @@
Left empty on purpose

View File

@ -118,6 +118,7 @@
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/> <column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/> <column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="url" phpName="DbUrl" type="VARCHAR" size="255" required="false" defaultValue=""/> <column name="url" phpName="DbUrl" type="VARCHAR" size="255" required="false" defaultValue=""/>
<column name="genre" phpName="DbGenre" type="VARCHAR" size="255" required="false" defaultValue=""/>
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/> <column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/>
<column name="color" phpName="DbColor" type="VARCHAR" size="6" required="false"/> <column name="color" phpName="DbColor" type="VARCHAR" size="6" required="false"/>
<column name="background_color" phpName="DbBackgroundColor" type="VARCHAR" size="6" required="false"/> <column name="background_color" phpName="DbBackgroundColor" type="VARCHAR" size="6" required="false"/>

View File

@ -142,6 +142,7 @@ CREATE TABLE "cc_show"
"id" serial NOT NULL, "id" serial NOT NULL,
"name" VARCHAR(255) default '' NOT NULL, "name" VARCHAR(255) default '' NOT NULL,
"url" VARCHAR(255) default '', "url" VARCHAR(255) default '',
"genre" VARCHAR(255) default '',
"description" VARCHAR(512), "description" VARCHAR(512),
"color" VARCHAR(6), "color" VARCHAR(6),
"background_color" VARCHAR(6), "background_color" VARCHAR(6),

View File

@ -0,0 +1,28 @@
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
class Version20110402164819 extends AbstractMigration
{
public function up(Schema $schema)
{
//start cc_show modifications
$show_table = $schema->getTable('cc_show');
$show_table->addColumn('genre', 'string', array('notnull' => 0, 'length' => 255, 'default' => ""));
//end cc_show modifications
}
public function down(Schema $schema)
{
//start cc_show modifications
$show_table = $schema->getTable('cc_show');
$show_table->dropColumn('genre');
//end cc_show modifications
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1085,7 +1085,7 @@ button.ui-button-icons-only {
padding-right: 2.1em; padding-right: 2.1em;
} }
/* no icon support for input elements, provide padding by default */ /* no icon support for input elements, provide padding by default */
input.ui-button, button.ui-button { input.ui-button {
padding: .4em 1em; padding: .4em 1em;
} }
/*button icon element(s) */ /*button icon element(s) */
@ -1093,6 +1093,7 @@ input.ui-button, button.ui-button {
position: absolute; position: absolute;
top: 50%; top: 50%;
margin-top: -8px; margin-top: -8px;
left: 0.2em;
} }
.ui-button-icon-only .ui-icon { .ui-button-icon-only .ui-icon {
left: 50%; left: 50%;
@ -1117,10 +1118,12 @@ input.ui-button, button.ui-button {
} }
/* workarounds */ /* workarounds */
/*button.ui-button::-moz-focus-inner {
border: 0; button.ui-button.::-moz-focus-inner {
padding: 0; border: 0;
}*/ padding: 0;
}
/* reset extra padding in Firefox */ /* reset extra padding in Firefox */
/* /*
* jQuery UI Dialog 1.8.6 * jQuery UI Dialog 1.8.6
@ -1514,4 +1517,4 @@ padding: 0;
.ui-datepicker { .ui-datepicker {
display:none; display:none;
} }

View File

@ -1269,9 +1269,8 @@ div.success{
margin: 0 0 8px 0; margin: 0 0 8px 0;
} }
#schedule-add-show .button-bar.bottom { #schedule-add-show .button-bar.bottom {
margin: 16px 0 0 0; margin: 16px 0 0;
} }
.schedule { .schedule {
text-align:left; text-align:left;
height:38px; height:38px;
@ -1512,6 +1511,11 @@ 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.progress {
background:url(images/upload-icon.gif) no-repeat;
background-color:black;
background-position:center;
}
.medium-icon { .medium-icon {
display:block; display:block;
width:25px; width:25px;
@ -1541,3 +1545,52 @@ div.success{
.medium-icon.finishedplaying { .medium-icon.finishedplaying {
background:url(images/icon_finishedplaying_m.png) no-repeat 0 0; background:url(images/icon_finishedplaying_m.png) no-repeat 0 0;
} }
.preferences {
width: 500px;
}
dt.block-display, dd.block-display {
display: block;
float: none;
margin-left: 0;
padding-left: 0;
}
.preferences dt.block-display, .preferences dd.block-display {
padding: 0 0 5px 0;
}
.preferences dd.block-display {
margin-bottom:4px;
}
.preferences dd.block-display:last-child {
margin-bottom:0;
}
.simple-formblock dd.block-display {
width: 100%;
}
.preferences input[type="radio"] {
margin:0;
}
.preferences label input[type="radio"] {
margin:0 1px 0 0;
}
.preferences label input[type="checkbox"] {
margin:0 5px 0 0;
}
dd.radio-inline-list, .preferences dd.radio-inline-list {
margin-bottom:6px;
}
.radio-inline-list label {
margin-right:12px;
}
.preferences.simple-formblock dd.block-display {
width: 100%;
}
.preferences dd.block-display .input_select {
width: 100%;
}
.preferences dd.block-display .input_text_area, .preferences dd.block-display .input_text {
width: 99.5%;
}
.preferences dd#SoundCloudTags-element.block-display .input_text_area {
height: 120px;
}

View File

@ -0,0 +1,17 @@
$(document).ready(function() {
var form = $("form");
form.find("h3").click(function(){
var h3 = $(this);
h3.next().toggle();
if(h3.hasClass("close")) {
h3.removeClass("close");
}
else {
h3.addClass("close");
}
});
});

View File

@ -148,8 +148,8 @@ function viewDisplay( view ) {
function eventRender(event, element, view) { function eventRender(event, element, view) {
//only put progress bar on shows that aren't being recorded and are not a rebroadcast. //only put progress bar on shows that aren't being recorded.
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.record === 0 /* && event.rebroadcast === 0 */) { if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.record === 0) {
var div = $('<div/>'); var div = $('<div/>');
div div
.height('5px') .height('5px')
@ -168,15 +168,17 @@ function eventRender(event, element, view) {
} }
//add the record/rebroadcast icons if needed. //add the record/rebroadcast icons if needed.
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.record === 1) {
//record icon (only if not on soundcloud, will always be true for future events)
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.record === 1 && event.soundcloud_id === -1) {
$(element).find(".fc-event-time").after('<span class="small-icon recording"></span>'); $(element).find(".fc-event-time").after('<span class="small-icon recording"></span>');
} }
if(view.name === 'month' && event.record === 1) { if(view.name === 'month' && event.record === 1 && event.soundcloud_id === -1) {
$(element).find(".fc-event-title").after('<span class="small-icon recording"></span>'); $(element).find(".fc-event-title").after('<span class="small-icon recording"></span>');
} }
//rebroadcast icon
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.rebroadcast === 1) { if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.rebroadcast === 1) {
$(element).find(".fc-event-time").after('<span class="small-icon rebroadcast"></span>'); $(element).find(".fc-event-time").after('<span class="small-icon rebroadcast"></span>');
@ -185,12 +187,12 @@ function eventRender(event, element, view) {
$(element).find(".fc-event-title").after('<span class="small-icon rebroadcast"></span>'); $(element).find(".fc-event-title").after('<span class="small-icon rebroadcast"></span>');
} }
//soundcloud icon
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.soundcloud_id != -1 && event.record === 1) { if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.soundcloud_id !== -1 && event.record === 1) {
$(element).find(".fc-event-time").after('<span class="small-icon soundcloud"></span>'); $(element).find(".fc-event-time").after('<span class="small-icon soundcloud"></span>');
} }
if(view.name === 'month' && event.soundcloud_id != -1 && event.record === 1) { if(view.name === 'month' && event.soundcloud_id !== -1 && event.record === 1) {
$(element).find(".fc-event-title").after('<span class="small-icon soundcloud"></span>'); $(element).find(".fc-event-title").after('<span class="small-icon soundcloud"></span>');
} }

View File

@ -165,6 +165,29 @@ function confirmCancelShow(show_instance_id){
} }
} }
function uploadToSoundCloud(show_instance_id){
var url = "/Schedule/upload-to-sound-cloud";
var span = $(window.triggerElement).find(".recording");
span.removeClass("recording")
.addClass("progress");
$.post(url,
{id: show_instance_id, format: "json"},
function(data){
if(data.error) {
span.removeClass("progress")
.addClass("recording");
alert(data.error);
return;
}
scheduleRefetchEvents();
});
}
function buildContentDialog(json){ function buildContentDialog(json){
var dialog = $(json.dialog); var dialog = $(json.dialog);

View File

@ -47,18 +47,20 @@ def getDateTimeObj(time):
class ShowRecorder(Thread): class ShowRecorder(Thread):
def __init__ (self, show_instance, filelength, filename, filetype): def __init__ (self, show_instance, filelength, show_name, start_time, filetype):
Thread.__init__(self) Thread.__init__(self)
self.api_client = api_client.api_client_factory(config) self.api_client = api_client.api_client_factory(config)
self.filelength = filelength self.filelength = filelength
self.filename = filename self.show_name = show_name
self.start_time = start_time
self.filetype = filetype self.filetype = filetype
self.show_instance = show_instance self.show_instance = show_instance
def record_show(self): def record_show(self):
length = str(self.filelength)+".0" length = str(self.filelength)+".0"
filename = self.filename.replace(" ", "-") filename = self.show_name+" "+self.start_time
filename = filename.replace(" ", "-")
filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype) filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype)
command = "ecasound -i alsa -o %s -t:%s" % (filepath, length) command = "ecasound -i alsa -o %s -t:%s" % (filepath, length)
@ -134,9 +136,8 @@ class Record():
show_length = self.shows_to_record[start_time][0] show_length = self.shows_to_record[start_time][0]
show_instance = self.shows_to_record[start_time][1] show_instance = self.shows_to_record[start_time][1]
show_name = self.shows_to_record[start_time][2] show_name = self.shows_to_record[start_time][2]
filename = show_name+"-"+start_time
show = ShowRecorder(show_instance, show_length.seconds, show_name, start_time, filetype="mp3", )
show = ShowRecorder(show_instance, show_length.seconds, filename, filetype="mp3")
show.start() show.start()
#remove show from shows to record. #remove show from shows to record.