CC-2795: Give option to set download flag of recorded shows uploaded

to Soundcloud by default

- fixed name of Soundcloud Model class
This commit is contained in:
James 2011-10-03 18:02:01 -04:00
parent d4063a8234
commit b4d4c54c31
5 changed files with 5 additions and 6 deletions

View File

@ -13,6 +13,7 @@ require_once 'DB.php';
require_once 'Preference.php'; require_once 'Preference.php';
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php'; require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
require_once 'soundcloud-api/Services/Soundcloud.php';
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
$dsn = $CC_CONFIG['dsn']; $dsn = $CC_CONFIG['dsn'];

View File

@ -400,7 +400,7 @@ class ApiController extends Zend_Controller_Action
$tags = array_merge($hosts, array($show_name)); $tags = array_merge($hosts, array($show_name));
try { try {
$soundcloud = new Application_Model_AtSoundcloud(); $soundcloud = new Application_Model_Soundcloud();
$soundcloud_id = $soundcloud->uploadTrack($file->getFilePath(), $tmpTitle, $description, $tags, $show_start_time, $show_genre); $soundcloud_id = $soundcloud->uploadTrack($file->getFilePath(), $tmpTitle, $description, $tags, $show_start_time, $show_genre);
$file->setSoundCloudFileId($soundcloud_id); $file->setSoundCloudFileId($soundcloud_id);
break; break;

View File

@ -1,8 +1,6 @@
<?php <?php
require_once 'soundcloud-api/Services/Soundcloud.php'; class Application_Model_Soundcloud {
class Application_Model_AtSoundcloud {
private $_soundcloud; private $_soundcloud;

View File

@ -944,7 +944,7 @@ class Application_Model_StoredFile {
$genre = $file->getDbGenre(); $genre = $file->getDbGenre();
$release = $file->getDbYear(); $release = $file->getDbYear();
try { try {
$soundcloud = new Application_Model_AtSoundcloud(); $soundcloud = new Application_Model_Soundcloud();
$soundcloud_id = $soundcloud->uploadTrack($this->getFilePath(), $this->getName(), $description, $tag, $release, $genre); $soundcloud_id = $soundcloud->uploadTrack($this->getFilePath(), $this->getName(), $description, $tag, $release, $genre);
$this->setSoundCloudFileId($soundcloud_id); $this->setSoundCloudFileId($soundcloud_id);
break; break;

View File

@ -426,8 +426,8 @@ class AirTimeApiClient(ApiClientInterface):
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["upload_recorded"]) url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["upload_recorded"])
url = url.replace("%%fileid%%", str(response[u'id'])) url = url.replace("%%fileid%%", str(response[u'id']))
url = url.replace("%%showinstanceid%%", str(md['MDATA_KEY_TRACKNUMBER'])) url = url.replace("%%showinstanceid%%", str(md['MDATA_KEY_TRACKNUMBER']))
logger.debug(url)
url = url.replace("%%api_key%%", self.config["api_key"]) url = url.replace("%%api_key%%", self.config["api_key"])
logger.debug(url)
req = urllib2.Request(url) req = urllib2.Request(url)
response = urllib2.urlopen(req).read() response = urllib2.urlopen(req).read()