CC-1799 Put Airtime Storage into a Human Readable File Naming Convention

seems mutagen needs everything cast as a string, or one field. Was throwing an exception with no message not sure.
This commit is contained in:
Naomi Aro 2011-06-15 14:20:14 +02:00
parent a05b02b0dc
commit 5b26f34033
4 changed files with 42 additions and 13 deletions

View file

@ -13,12 +13,11 @@ define('MDATA_KEY_SOURCE', 'album_title');
define('MDATA_KEY_DURATION', 'length');
define('MDATA_KEY_MIME', 'mime');
define('MDATA_KEY_FTYPE', 'ftype');
define('MDATA_KEY_URL', 'url');
define('MDATA_KEY_URL', 'info_url');
define('MDATA_KEY_GENRE', 'genre');
define('MDATA_KEY_MOOD', 'mood');
define('MDATA_KEY_LABEL', 'label');
define('MDATA_KEY_COMPOSER', 'composer');
define('MDATA_KEY_FORMAT', 'format');
define('MDATA_KEY_DESCRIPTION', 'description');
define('MDATA_KEY_SAMPLERATE', 'sample_rate');
define('MDATA_KEY_BITRATE', 'bit_rate');

View file

@ -164,8 +164,7 @@ class LibraryController extends Zend_Controller_Action
$formdata = $form->getValues();
$file->setDbColMetadata($formdata);
$data = $formdata;
$data['filepath'] = $file->getFilePath();
$data = $file->getMetadata();
RabbitMq::SendFileMetaData($data);

View file

@ -190,6 +190,27 @@ class StoredFile {
return $md;
}
/**
* Get metadata as array, indexed by the constant names.
*
* @return array
*/
public function getMetadata()
{
$c = get_defined_constants(true);
$md = array();
foreach ($c['user'] as $constant => $value) {
if (preg_match('/^MDATA_KEY/', $constant)) {
if (isset($this->_dbMD[$value])) {
$md[$constant] = $this->getDbColMetadataValue($value);
}
}
}
return $md;
}
/**
* Delete and insert media file
*