CC-1799 : Live Studio Playout from media library (pytagsfs)
metadata almost working from airtime form -> python daemon. Just need to look into permissions for some stor folders.
This commit is contained in:
parent
5be039d349
commit
a3d7c5e70b
5 changed files with 144 additions and 11 deletions
|
@ -168,6 +168,10 @@ class LibraryController extends Zend_Controller_Action
|
|||
$formdata = $form->getValues();
|
||||
$file->replaceDbMetadata($formdata);
|
||||
|
||||
$data = $formdata;
|
||||
$data['filepath'] = $file->getRealFilePath();
|
||||
RabbitMq::SendFileMetaData($data);
|
||||
|
||||
$this->_helper->redirector('index');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,24 @@
|
|||
|
||||
class Application_Form_EditAudioMD extends Zend_Form
|
||||
{
|
||||
/*
|
||||
"title": "track_title",\
|
||||
"artist": "artist_name",\
|
||||
"album": "album_title",\
|
||||
"genre": "genre",\
|
||||
"mood": "mood",\
|
||||
"tracknumber": "track_number",\
|
||||
"bpm": "bpm",\
|
||||
"organization": "label",\
|
||||
"composer": "composer",\
|
||||
"encodedby": "encoded_by",\
|
||||
"conductor": "conductor",\
|
||||
"date": "year",\
|
||||
"website": "info_url",\
|
||||
"isrc": "isrc_number",\
|
||||
"copyright": "copyright",\
|
||||
*/
|
||||
|
||||
|
||||
public function init()
|
||||
{
|
||||
|
@ -37,6 +55,13 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
||||
// Add mood field
|
||||
$this->addElement('text', 'track_number', array(
|
||||
'label' => 'Track:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
||||
// Add genre field
|
||||
$this->addElement('text', 'genre', array(
|
||||
'label' => 'Genre:',
|
||||
|
@ -77,9 +102,30 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
||||
// Add language field
|
||||
$this->addElement('text', 'language', array(
|
||||
'label' => 'Language:',
|
||||
// Add mood field
|
||||
$this->addElement('text', 'bpm', array(
|
||||
'label' => 'BPM:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
||||
// Add mood field
|
||||
$this->addElement('text', 'copyright', array(
|
||||
'label' => 'Copyright:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
||||
// Add mood field
|
||||
$this->addElement('text', 'isrc_number', array(
|
||||
'label' => 'ISRC Number:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
||||
// Add mood field
|
||||
$this->addElement('text', 'info_url', array(
|
||||
'label' => 'Website:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
|
|
@ -40,5 +40,27 @@ class RabbitMq
|
|||
}
|
||||
}
|
||||
|
||||
public static function SendFileMetaData($md)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$conn = new AMQPConnection($CC_CONFIG["rabbitmq"]["host"],
|
||||
$CC_CONFIG["rabbitmq"]["port"],
|
||||
$CC_CONFIG["rabbitmq"]["user"],
|
||||
$CC_CONFIG["rabbitmq"]["password"]);
|
||||
$channel = $conn->channel();
|
||||
$channel->access_request($CC_CONFIG["rabbitmq"]["vhost"], false, false, true, true);
|
||||
|
||||
$EXCHANGE = 'airtime-media-monitor';
|
||||
$channel->exchange_declare($EXCHANGE, 'direct', false, true);
|
||||
|
||||
$data = json_encode($md);
|
||||
$msg = new AMQPMessage($data, array('content_type' => 'text/plain'));
|
||||
|
||||
$channel->basic_publish($msg, $EXCHANGE);
|
||||
$channel->close();
|
||||
$conn->close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue