Add fields to SoundCloud upload

This commit is contained in:
Duncan Sommerville 2015-06-24 15:46:53 -04:00
parent f26559c0c6
commit e44e0de534
2 changed files with 8 additions and 1 deletions

View file

@ -73,6 +73,9 @@ class Application_Model_StoredFile
return $this->_file->getDbFtype(); return $this->_file->getDbFtype();
} }
/**
* @return CcFiles
*/
public function getPropelOrm() public function getPropelOrm()
{ {
return $this->_file; return $this->_file;

View file

@ -68,8 +68,12 @@ class SoundcloudService extends ThirdPartyCeleryService implements OAuth2 {
* @return array the track array to send to SoundCloud * @return array the track array to send to SoundCloud
*/ */
protected function _getUploadData($file) { protected function _getUploadData($file) {
$file = $file->getPropelOrm();
// TODO: Move this into a proper serializer
$trackArray = array( $trackArray = array(
'title' => $file->getName(), 'title' => $file->getDbName(),
'genre' => $file->getDbGenre(),
'bpm' => $file->getDbBpm(),
); );
foreach (self::$_SOUNDCLOUD_PREF_FUNCTIONS as $func => $param) { foreach (self::$_SOUNDCLOUD_PREF_FUNCTIONS as $func => $param) {
$val = Application_Model_Preference::$func(); $val = Application_Model_Preference::$func();