From e44e0de5346cd6398e7b7151d77d627207e4ac72 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Wed, 24 Jun 2015 15:46:53 -0400 Subject: [PATCH] Add fields to SoundCloud upload --- airtime_mvc/application/models/StoredFile.php | 3 +++ airtime_mvc/application/services/SoundcloudService.php | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index ac639b9bb..b14975b1d 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -73,6 +73,9 @@ class Application_Model_StoredFile return $this->_file->getDbFtype(); } + /** + * @return CcFiles + */ public function getPropelOrm() { return $this->_file; diff --git a/airtime_mvc/application/services/SoundcloudService.php b/airtime_mvc/application/services/SoundcloudService.php index 4aac783a7..93e1e9041 100644 --- a/airtime_mvc/application/services/SoundcloudService.php +++ b/airtime_mvc/application/services/SoundcloudService.php @@ -68,8 +68,12 @@ class SoundcloudService extends ThirdPartyCeleryService implements OAuth2 { * @return array the track array to send to SoundCloud */ protected function _getUploadData($file) { + $file = $file->getPropelOrm(); + // TODO: Move this into a proper serializer $trackArray = array( - 'title' => $file->getName(), + 'title' => $file->getDbName(), + 'genre' => $file->getDbGenre(), + 'bpm' => $file->getDbBpm(), ); foreach (self::$_SOUNDCLOUD_PREF_FUNCTIONS as $func => $param) { $val = Application_Model_Preference::$func();