From 35b2ddfd295e0fa46f8aa7ea36759af6fd5274cb Mon Sep 17 00:00:00 2001 From: naomiaro Date: Thu, 24 Mar 2011 17:43:37 -0400 Subject: [PATCH] CC-2097 : Show-recorder: Use RabbitMQ, api_client, and the structure of pypofetch setting up configs --- application/controllers/ApiController.php | 6 ++++++ application/views/helpers/SoundCloudLink.php | 22 -------------------- install/installInit.php | 1 + python_apps/show-recorder/config.cfg | 9 ++++++++ 4 files changed, 16 insertions(+), 22 deletions(-) delete mode 100644 application/views/helpers/SoundCloudLink.php diff --git a/application/controllers/ApiController.php b/application/controllers/ApiController.php index f7ff37eb1..5ca3b51c5 100644 --- a/application/controllers/ApiController.php +++ b/application/controllers/ApiController.php @@ -150,6 +150,12 @@ class ApiController extends Zend_Controller_Action } } + public function recordedShowsAction() + { + $today_timestamp = date("Y-m-d H:i:s"); + $this->view->shows = Show::getShows($today_timestamp, null, $excludeInstance=NULL, $onlyRecord=TRUE); + } + public function notifyMediaItemStartPlayAction() { global $CC_CONFIG; diff --git a/application/views/helpers/SoundCloudLink.php b/application/views/helpers/SoundCloudLink.php deleted file mode 100644 index 9f4d321e5..000000000 --- a/application/views/helpers/SoundCloudLink.php +++ /dev/null @@ -1,22 +0,0 @@ -getRequest(); - $host = $request->getHttpHost(); - $controller = $request->getControllerName(); - $action = $request->getActionName(); - - $redirectUrl = "http://{$host}/{$controller}/{$action}"; - - $soundcloud = new Services_Soundcloud('2CLCxcSXYzx7QhhPVHN4A', 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs', $redirectUrl); - $authorizeUrl = $soundcloud->getAuthorizeUrl(); - - return $authorizeUrl; - } -} - diff --git a/install/installInit.php b/install/installInit.php index 84fe04b81..1efaa4833 100644 --- a/install/installInit.php +++ b/install/installInit.php @@ -80,6 +80,7 @@ class AirtimeInstall { $api_key = AirtimeInstall::GenerateRandomString(); AirtimeInstall::UpdateIniValue(__DIR__.'/../build/airtime.conf', 'api_key', $api_key); AirtimeInstall::UpdateIniValue(__DIR__.'/../python_apps/pypo/config.cfg', 'api_key', "'$api_key'"); + AirtimeInstall::UpdateIniValue(__DIR__.'/../python_apps/show-recorder/config.cfg', 'api_key', "'$api_key'"); } public static function ExitIfNotRoot() diff --git a/python_apps/show-recorder/config.cfg b/python_apps/show-recorder/config.cfg index d1bb763ab..b74713841 100644 --- a/python_apps/show-recorder/config.cfg +++ b/python_apps/show-recorder/config.cfg @@ -7,3 +7,12 @@ upload_file_url = 'Plupload/upload-recorded/format/json' # base path to store recordered shows at base_recorded_files = '/home/pypo/Music/' + +# Value needed to access the API +api_key = 'AAA' + +# Path to the base of the API +api_base = 'api/' + +# URL to get the version number of the server API +version_url = 'version/api_key/%%api_key%%'