cc-2182: Convert back to restful design

-done
This commit is contained in:
martin 2011-05-02 16:33:37 -04:00
parent 9e01e389ea
commit 8e2019a935
10 changed files with 9 additions and 8 deletions

View File

@ -1,2 +1,2 @@
PRODUCT_ID=Airtime
PRODUCT_RELEASE=1.8.1
PRODUCT_RELEASE=1.9.0-devel

View File

@ -6,7 +6,7 @@
* /etc/airtime/recorder.cfg
*/
define('AIRTIME_VERSION', '1.8.1');
define('AIRTIME_VERSION', '1.9.0-devel');
define('AIRTIME_COPYRIGHT_DATE', '2010-2011');
define('AIRTIME_REST_VERSION', '1.1');
@ -78,6 +78,7 @@ class Config {
$CC_CONFIG['dsn']['username'] = $values['database']['dbuser'];
$CC_CONFIG['dsn']['password'] = $values['database']['dbpass'];
$CC_CONFIG['dsn']['hostspec'] = $values['database']['host'];
$CC_CONFIG['dsn']['phptype'] = 'pgsql';
$CC_CONFIG['dsn']['database'] = $values['database']['dbname'];
$CC_CONFIG['apiKey'] = array($values['general']['api_key']);

View File

@ -163,7 +163,7 @@ class ApiController extends Zend_Controller_Action
$this->_helper->viewRenderer->setNoRender(true);
$api_key = $this->_getParam('api_key');
if(!in_array($api_key, $CC_CONFIG["apiKey"]))
{
header('HTTP/1.0 401 Unauthorized');

View File

@ -1513,8 +1513,7 @@ class StoredFile {
public function getFileUrl()
{
global $CC_CONFIG;
return "http://$CC_CONFIG[baseUrl]:$CC_CONFIG[basePort]/".$this->gunid.".".$this->getFileExtension();
//return $CC_CONFIG["base_url"]..$this->gunid.".".$this->getFileExtension();
return "http://$CC_CONFIG[baseUrl]:$CC_CONFIG[basePort]/api/get-media/file/".$this->gunid.".".$this->getFileExtension();
}
/**

View File

@ -222,11 +222,12 @@ class AirTimeApiClient(ApiClientInterface):
try:
#src = "http://%s:%s/%s/%s" % \
#(self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["get_media_url"])
src = uri
src = uri + "/api_key/%%api_key%%"
logger.info("try to download from %s to %s", src, dst)
src = src.replace("%%api_key%%", self.config["api_key"])
# check if file exists already before downloading again
filename, headers = urllib.urlretrieve(src, dst)
logger.info(headers)
except Exception, e:
logger.error("%s", e)

View File

@ -96,10 +96,10 @@ try:
if platform.architecture()[0] == '64bit':
print "Installing 64-bit liquidsoap binary"
shutil.copy("%s/../liquidsoap/liquidsoap64"%current_script_dir, "%s/../liquidsoap/liquidsoap"%current_script_dir)
shutil.copy("%s/../liquidsoap/liquidsoap-amd64"%current_script_dir, "%s/../liquidsoap/liquidsoap"%current_script_dir)
elif platform.architecture()[0] == '32bit':
print "Installing 32-bit liquidsoap binary"
shutil.copy("%s/../liquidsoap/liquidsoap32"%current_script_dir, "%s/../liquidsoap/liquidsoap"%current_script_dir)
shutil.copy("%s/../liquidsoap/liquidsoap-i386"%current_script_dir, "%s/../liquidsoap/liquidsoap"%current_script_dir)
else:
print "Unknown system architecture."
sys.exit(1)

Binary file not shown.

Binary file not shown.