CC-2591: Allow upload of any audio clip to Soundcloud

- done
- need more styling
- note there were changes in style.css
This commit is contained in:
James 2011-09-22 11:47:24 -04:00
parent 8679194c33
commit 73dc4b851d
28 changed files with 833 additions and 238 deletions

View File

@ -73,7 +73,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-1.5.2.min.js','text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-ui-1.8.11.custom.min.js','text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery.stickyPanel.js','text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/qtip/jquery.qtip-1.0.0.min.js','text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/qtip/jquery.qtip2.min.js','text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/jplayer/jquery.jplayer.min.js');

View File

@ -1,6 +1,6 @@
<?php
// This file generated by Propel 1.5.2 convert-conf target
// from XML runtime conf file /home/martin/workspace/airtime/airtime_mvc/build/runtime-conf.xml
// from XML runtime conf file /home/james/src/airtime/airtime_mvc/build/runtime-conf.xml
$conf = array (
'datasources' =>
array (

View File

@ -402,7 +402,7 @@ class ApiController extends Zend_Controller_Action
try {
$soundcloud = new ATSoundcloud();
$soundcloud_id = $soundcloud->uploadTrack($file->getFilePath(), $tmpTitle, $description, $tags, $show_start_time, $show_genre);
$show_inst->setSoundCloudFileId($soundcloud_id);
$file->setSoundCloudFileId($soundcloud_id);
break;
}
catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {

View File

@ -13,6 +13,8 @@ class LibraryController extends Zend_Controller_Action
->addActionContext('delete', 'json')
->addActionContext('context-menu', 'json')
->addActionContext('get-file-meta-data', 'html')
->addActionContext('upload-file-soundcloud', 'json')
->addActionContext('get-upload-to-sc-status', 'json')
->initContext();
$this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME);
@ -33,6 +35,8 @@ class LibraryController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl.'/css/media_library.css');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/contextmenu.css');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/qtip/jquery.qtip.min.css');
$this->_helper->layout->setLayout('library');
$this->_helper->viewRenderer->setResponseSegment('library');
@ -86,7 +90,15 @@ class LibraryController extends Zend_Controller_Action
$url = $file->getRelativeFileUrl($baseUrl).'/api_key/'.$CC_CONFIG["apiKey"][0].'/download/true';
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
'title' => 'Download');
if (Application_Model_Preference::GetDoSoundCloudUpload()) {
$text = "Upload to Soundcloud";
if(!is_null($file->getSoundCloudId())){
$text = "Re-upload to Soundcloud";
}
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Library/upload-file-soundcloud/id/#id#',
'callback'=>'window["redrawDataTable"]'),'title' => $text);
}
if ($user->isAdmin()) {
$menu[] = array('action' => array('type' => 'fn',
@ -167,6 +179,17 @@ class LibraryController extends Zend_Controller_Action
//format clip lengh to 1 decimal
foreach($datatables["aaData"] as &$data){
if($data[6] == 'audioclip'){
$file = StoredFile::Recall($data[0]);
$scid = $file->getSoundCloudId();
if($scid == "-2"){
$data[1] .= '<span id="'.$data[0].'" class="small-icon progress"></span>';
}else if($scid == "-3"){
$data[1] .= '<span id="'.$data[0].'" class="small-icon sc-error"></span>';
}else if(!is_null($scid)){
$data[1] .= '<span id="'.$data[0].'" class="small-icon soundcloud"></span>';
}
}
$sec = Playlist::playlistTimeToSeconds($data[5]);
$data[5] = Playlist::secondsToPlaylistTime($sec);
}
@ -218,4 +241,28 @@ class LibraryController extends Zend_Controller_Action
}
}
public function uploadFileSoundcloudAction(){
$id = $this->_getParam('id');
$res = exec("/usr/lib/airtime/utils/soundcloud-uploader $id > /dev/null &");
// we should die with ui info
die();
}
public function getUploadToScStatusAction(){
$id = $this->_getParam('id');
$type = $this->_getParam('type');
if($type == "show"){
$show_instance = new ShowInstance($id);
$this->view->sc_id = $show_instance->getSoundCloudFileId();
$file = $show_instance->getRecordedFile();
$this->view->error_code = $file->getSoundCloudErrorCode();
$this->view->error_msg = $file->getSoundCloudErrorMsg();
}else{
$file = StoredFile::Recall($id);
$this->view->sc_id = $file->getSoundCloudId();
$this->view->error_code = $file->getSoundCloudErrorCode();
$this->view->error_msg = $file->getSoundCloudErrorMsg();
}
}
}

View File

@ -53,6 +53,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl.'/css/colorpicker/css/colorpicker.css');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/add-show.css');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/contextmenu.css');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/qtip/jquery.qtip.min.css');
Schedule::createNewFormSections($this->view);
@ -134,43 +135,10 @@ class ScheduleController extends Zend_Controller_Action
$show_inst = new ShowInstance($show_instance);
$file = $show_inst->getRecordedFile();
if(is_null($file)) {
$this->view->error = "Recorded file does not exist";
return;
}
$show_name = $show_inst->getName();
$show_genre = $show_inst->getGenre();
$show_start_time = $show_inst->getShowStart();
if(Application_Model_Preference::GetDoSoundCloudUpload())
{
for($i=0; $i<$CC_CONFIG['soundcloud-connection-retries']; $i++) {
$show = new Show($show_inst->getShowId());
$description = $show->getDescription();
$hosts = $show->getHosts();
$tags = array_merge($hosts, array($show_name));
try {
$soundcloud = new ATSoundcloud();
$soundcloud_id = $soundcloud->uploadTrack($file->getFilePath(), $file->getName(), $description, $tags, $show_start_time, $show_genre);
$show_inst->setSoundCloudFileId($soundcloud_id);
$this->view->soundcloud_id = $soundcloud_id;
break;
}
catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
$code = $e->getHttpCode();
if(!in_array($code, array(0, 100))) {
break;
}
}
sleep($CC_CONFIG['soundcloud-connection-wait']);
}
}
$id = $file->getId();
$res = exec("/usr/lib/airtime/utils/soundcloud-uploader $id > /dev/null &");
// we should die with ui info
die();
}
public function makeContextMenuAction()
@ -206,12 +174,17 @@ class ScheduleController extends Zend_Controller_Action
}
if ($showEndDateHelper->getTimestamp() <= $epochNow
&& is_null($show->getSoundCloudFileId())
&& $show->isRecorded()
&& Application_Model_Preference::GetDoSoundCloudUpload()) {
$menu[] = array('action' => array('type' => 'fn',
'callback' => "window['uploadToSoundCloud']($id)"),
'title' => 'Upload to Soundcloud');
if(is_null($show->getSoundCloudFileId())){
$menu[] = array('action' => array('type' => 'fn',
'callback' => "window['uploadToSoundCloud']($id)"),
'title' => 'Upload to Soundcloud');
}else{
$menu[] = array('action' => array('type' => 'fn',
'callback' => "window['uploadToSoundCloud']($id)"),
'title' => 'Re-upload to Soundcloud');
}
}

View File

@ -898,8 +898,8 @@ class Show {
Application_Model_Preference::SetShowsPopulatedUntil($end_timestamp);
}
$sql = "SELECT starts, ends, record, rebroadcast, soundcloud_id, instance_id, show_id, name, description,
color, background_color, cc_show_instances.id AS instance_id
$sql = "SELECT starts, ends, record, rebroadcast, instance_id, show_id, name, description,
color, background_color, file_id, cc_show_instances.id AS instance_id
FROM cc_show_instances
LEFT JOIN cc_show ON cc_show.id = cc_show_instances.show_id";
@ -1242,7 +1242,15 @@ class Show {
$event["showId"] = $show["show_id"];
$event["record"] = intval($show["record"]);
$event["rebroadcast"] = intval($show["rebroadcast"]);
$event["soundcloud_id"] = (is_null($show["soundcloud_id"]) ? -1 : $show["soundcloud_id"]);
// get soundcloud_id
if(!is_null($show["file_id"])){
$file = StoredFile::Recall($show["file_id"]);
$soundcloud_id = $file->getSoundCloudId();
}else{
$soundcloud_id = null;
}
$event["soundcloud_id"] = (is_null($soundcloud_id) ? -1 : $soundcloud_id);
//event colouring
if($show["color"] != "") {
@ -1356,13 +1364,14 @@ class ShowInstance {
public function setSoundCloudFileId($p_soundcloud_id)
{
$this->_showInstance->setDbSoundCloudId($p_soundcloud_id)
->save();
$file = StoredFile::Recall($this->_showInstance->getDbRecordedFile());
$file->setSoundCloudFileId($p_soundcloud_id);
}
public function getSoundCloudFileId()
{
return $this->_showInstance->getDbSoundCloudId();
$file = StoredFile::Recall($this->_showInstance->getDbRecordedFile());
return $file->getSoundCloudId();
}
public function getRecordedFile()

View File

@ -878,5 +878,74 @@ class StoredFile {
return $results;
}
public function setSoundCloudFileId($p_soundcloud_id)
{
$this->_file->setDbSoundCloudId($p_soundcloud_id)
->save();
}
public function getSoundCloudId(){
return $this->_file->getDbSoundCloudId();
}
public function setSoundCloudErrorCode($code){
$this->_file->setDbSoundCloudErrorCode($code)
->save();
}
public function getSoundCloudErrorCode(){
return $this->_file->getDbSoundCloudErrorCode();
}
public function setSoundCloudErrorMsg($msg){
$this->_file->setDbSoundCloudErrorMsg($msg)
->save();
}
public function getSoundCloudErrorMsg(){
return $this->_file->getDbSoundCloudErrorMsg();
}
public function uploadToSoundCloud()
{
global $CC_CONFIG;
$file = $this->_file;
if(is_null($file)) {
return "File does not exist";
}
if(Application_Model_Preference::GetDoSoundCloudUpload())
{
for($i=0; $i<$CC_CONFIG['soundcloud-connection-retries']; $i++) {
$description = $file->getDbTrackTitle();
$tag = "";
$genre = $file->getDbGenre();
$release = $file->getDbYear();
try {
$soundcloud = new ATSoundcloud();
$soundcloud_id = $soundcloud->uploadTrack($this->getFilePath(), $this->getName(), $description, $tag, $release, $genre);
$this->setSoundCloudFileId($soundcloud_id);
break;
}
catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
$code = $e->getHttpCode();
$msg = $e->getHttpBody();
$temp = explode('"error":',$msg);
$msg = trim($temp[1], '"}');
$this->setSoundCloudErrorCode($code);
$this->setSoundCloudErrorMsg($msg);
// setting sc id to -3 which indicates error
$this->setSoundCloudFileId(-3);
if(!in_array($code, array(0, 100))) {
break;
}
}
sleep($CC_CONFIG['soundcloud-connection-wait']);
}
}
}
}

View File

@ -38,7 +38,7 @@ class CcComponentTableMap extends TableMap {
$this->setUseIdGenerator(false);
// columns
$this->addPrimaryKey('NAME', 'DbName', 'VARCHAR', true, 32, null);
$this->addColumn('IP', 'DbIp', 'VARCHAR', true, 32, null);
$this->addColumn('IP', 'DbIp', 'VARCHAR', true, 18, null);
// validators
} // initialize()

View File

@ -93,6 +93,9 @@ class CcFilesTableMap extends TableMap {
$this->addColumn('SUBJECT', 'DbSubject', 'VARCHAR', false, 512, null);
$this->addColumn('CONTRIBUTOR', 'DbContributor', 'VARCHAR', false, 512, null);
$this->addColumn('LANGUAGE', 'DbLanguage', 'VARCHAR', false, 512, null);
$this->addColumn('SOUNDCLOUD_ID', 'DbSoundcloudId', 'INTEGER', false, null, null);
$this->addColumn('SOUNDCLOUD_ERROR_CODE', 'DbSoundcloudErrorCode', 'INTEGER', false, null, null);
$this->addColumn('SOUNDCLOUD_ERROR_MSG', 'DbSoundcloudErrorMsg', 'VARCHAR', false, 512, null);
// validators
} // initialize()

View File

@ -46,7 +46,6 @@ class CcShowInstancesTableMap extends TableMap {
$this->addColumn('REBROADCAST', 'DbRebroadcast', 'TINYINT', false, null, 0);
$this->addForeignKey('INSTANCE_ID', 'DbOriginalShow', 'INTEGER', 'cc_show_instances', 'ID', false, null, null);
$this->addForeignKey('FILE_ID', 'DbRecordedFile', 'INTEGER', 'cc_files', 'ID', false, null, null);
$this->addColumn('SOUNDCLOUD_ID', 'DbSoundCloudId', 'INTEGER', false, null, null);
$this->addColumn('TIME_FILLED', 'DbTimeFilled', 'TIME', false, null, null);
// validators
} // initialize()

View File

@ -360,6 +360,24 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
*/
protected $language;
/**
* The value for the soundcloud_id field.
* @var int
*/
protected $soundcloud_id;
/**
* The value for the soundcloud_error_code field.
* @var int
*/
protected $soundcloud_error_code;
/**
* The value for the soundcloud_error_msg field.
* @var string
*/
protected $soundcloud_error_msg;
/**
* @var CcSubjs
*/
@ -1021,6 +1039,36 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this->language;
}
/**
* Get the [soundcloud_id] column value.
*
* @return int
*/
public function getDbSoundcloudId()
{
return $this->soundcloud_id;
}
/**
* Get the [soundcloud_error_code] column value.
*
* @return int
*/
public function getDbSoundcloudErrorCode()
{
return $this->soundcloud_error_code;
}
/**
* Get the [soundcloud_error_msg] column value.
*
* @return string
*/
public function getDbSoundcloudErrorMsg()
{
return $this->soundcloud_error_msg;
}
/**
* Set the value of [id] column.
*
@ -2187,6 +2235,66 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this;
} // setDbLanguage()
/**
* Set the value of [soundcloud_id] column.
*
* @param int $v new value
* @return CcFiles The current object (for fluent API support)
*/
public function setDbSoundcloudId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->soundcloud_id !== $v) {
$this->soundcloud_id = $v;
$this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_ID;
}
return $this;
} // setDbSoundcloudId()
/**
* Set the value of [soundcloud_error_code] column.
*
* @param int $v new value
* @return CcFiles The current object (for fluent API support)
*/
public function setDbSoundcloudErrorCode($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->soundcloud_error_code !== $v) {
$this->soundcloud_error_code = $v;
$this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_ERROR_CODE;
}
return $this;
} // setDbSoundcloudErrorCode()
/**
* Set the value of [soundcloud_error_msg] column.
*
* @param string $v new value
* @return CcFiles The current object (for fluent API support)
*/
public function setDbSoundcloudErrorMsg($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->soundcloud_error_msg !== $v) {
$this->soundcloud_error_msg = $v;
$this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_ERROR_MSG;
}
return $this;
} // setDbSoundcloudErrorMsg()
/**
* Indicates whether the columns in this object are only set to default values.
*
@ -2298,6 +2406,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->subject = ($row[$startcol + 52] !== null) ? (string) $row[$startcol + 52] : null;
$this->contributor = ($row[$startcol + 53] !== null) ? (string) $row[$startcol + 53] : null;
$this->language = ($row[$startcol + 54] !== null) ? (string) $row[$startcol + 54] : null;
$this->soundcloud_id = ($row[$startcol + 55] !== null) ? (int) $row[$startcol + 55] : null;
$this->soundcloud_error_code = ($row[$startcol + 56] !== null) ? (int) $row[$startcol + 56] : null;
$this->soundcloud_error_msg = ($row[$startcol + 57] !== null) ? (string) $row[$startcol + 57] : null;
$this->resetModified();
$this->setNew(false);
@ -2306,7 +2417,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->ensureConsistency();
}
return $startcol + 55; // 55 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 58; // 58 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcFiles object", $e);
@ -2869,6 +2980,15 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
case 54:
return $this->getDbLanguage();
break;
case 55:
return $this->getDbSoundcloudId();
break;
case 56:
return $this->getDbSoundcloudErrorCode();
break;
case 57:
return $this->getDbSoundcloudErrorMsg();
break;
default:
return null;
break;
@ -2948,6 +3068,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$keys[52] => $this->getDbSubject(),
$keys[53] => $this->getDbContributor(),
$keys[54] => $this->getDbLanguage(),
$keys[55] => $this->getDbSoundcloudId(),
$keys[56] => $this->getDbSoundcloudErrorCode(),
$keys[57] => $this->getDbSoundcloudErrorMsg(),
);
if ($includeForeignObjects) {
if (null !== $this->aCcSubjs) {
@ -3152,6 +3275,15 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
case 54:
$this->setDbLanguage($value);
break;
case 55:
$this->setDbSoundcloudId($value);
break;
case 56:
$this->setDbSoundcloudErrorCode($value);
break;
case 57:
$this->setDbSoundcloudErrorMsg($value);
break;
} // switch()
}
@ -3231,6 +3363,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if (array_key_exists($keys[52], $arr)) $this->setDbSubject($arr[$keys[52]]);
if (array_key_exists($keys[53], $arr)) $this->setDbContributor($arr[$keys[53]]);
if (array_key_exists($keys[54], $arr)) $this->setDbLanguage($arr[$keys[54]]);
if (array_key_exists($keys[55], $arr)) $this->setDbSoundcloudId($arr[$keys[55]]);
if (array_key_exists($keys[56], $arr)) $this->setDbSoundcloudErrorCode($arr[$keys[56]]);
if (array_key_exists($keys[57], $arr)) $this->setDbSoundcloudErrorMsg($arr[$keys[57]]);
}
/**
@ -3297,6 +3432,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if ($this->isColumnModified(CcFilesPeer::SUBJECT)) $criteria->add(CcFilesPeer::SUBJECT, $this->subject);
if ($this->isColumnModified(CcFilesPeer::CONTRIBUTOR)) $criteria->add(CcFilesPeer::CONTRIBUTOR, $this->contributor);
if ($this->isColumnModified(CcFilesPeer::LANGUAGE)) $criteria->add(CcFilesPeer::LANGUAGE, $this->language);
if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_ID)) $criteria->add(CcFilesPeer::SOUNDCLOUD_ID, $this->soundcloud_id);
if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_ERROR_CODE)) $criteria->add(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $this->soundcloud_error_code);
if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_ERROR_MSG)) $criteria->add(CcFilesPeer::SOUNDCLOUD_ERROR_MSG, $this->soundcloud_error_msg);
return $criteria;
}
@ -3412,6 +3550,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$copyObj->setDbSubject($this->subject);
$copyObj->setDbContributor($this->contributor);
$copyObj->setDbLanguage($this->language);
$copyObj->setDbSoundcloudId($this->soundcloud_id);
$copyObj->setDbSoundcloudErrorCode($this->soundcloud_error_code);
$copyObj->setDbSoundcloudErrorMsg($this->soundcloud_error_msg);
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
@ -4066,6 +4207,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->subject = null;
$this->contributor = null;
$this->language = null;
$this->soundcloud_id = null;
$this->soundcloud_error_code = null;
$this->soundcloud_error_msg = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->clearAllReferences();

View File

@ -26,7 +26,7 @@ abstract class BaseCcFilesPeer {
const TM_CLASS = 'CcFilesTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 55;
const NUM_COLUMNS = 58;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@ -196,6 +196,15 @@ abstract class BaseCcFilesPeer {
/** the column name for the LANGUAGE field */
const LANGUAGE = 'cc_files.LANGUAGE';
/** the column name for the SOUNDCLOUD_ID field */
const SOUNDCLOUD_ID = 'cc_files.SOUNDCLOUD_ID';
/** the column name for the SOUNDCLOUD_ERROR_CODE field */
const SOUNDCLOUD_ERROR_CODE = 'cc_files.SOUNDCLOUD_ERROR_CODE';
/** the column name for the SOUNDCLOUD_ERROR_MSG field */
const SOUNDCLOUD_ERROR_MSG = 'cc_files.SOUNDCLOUD_ERROR_MSG';
/**
* An identiy map to hold any loaded instances of CcFiles objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
@ -212,12 +221,12 @@ abstract class BaseCcFilesPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbGunid', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::GUNID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbGunid', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::GUNID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, )
);
/**
@ -227,12 +236,12 @@ abstract class BaseCcFilesPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbGunid' => 1, 'DbName' => 2, 'DbMime' => 3, 'DbFtype' => 4, 'DbDirectory' => 5, 'DbFilepath' => 6, 'DbState' => 7, 'DbCurrentlyaccessing' => 8, 'DbEditedby' => 9, 'DbMtime' => 10, 'DbMd5' => 11, 'DbTrackTitle' => 12, 'DbArtistName' => 13, 'DbBitRate' => 14, 'DbSampleRate' => 15, 'DbFormat' => 16, 'DbLength' => 17, 'DbAlbumTitle' => 18, 'DbGenre' => 19, 'DbComments' => 20, 'DbYear' => 21, 'DbTrackNumber' => 22, 'DbChannels' => 23, 'DbUrl' => 24, 'DbBpm' => 25, 'DbRating' => 26, 'DbEncodedBy' => 27, 'DbDiscNumber' => 28, 'DbMood' => 29, 'DbLabel' => 30, 'DbComposer' => 31, 'DbEncoder' => 32, 'DbChecksum' => 33, 'DbLyrics' => 34, 'DbOrchestra' => 35, 'DbConductor' => 36, 'DbLyricist' => 37, 'DbOriginalLyricist' => 38, 'DbRadioStationName' => 39, 'DbInfoUrl' => 40, 'DbArtistUrl' => 41, 'DbAudioSourceUrl' => 42, 'DbRadioStationUrl' => 43, 'DbBuyThisUrl' => 44, 'DbIsrcNumber' => 45, 'DbCatalogNumber' => 46, 'DbOriginalArtist' => 47, 'DbCopyright' => 48, 'DbReportDatetime' => 49, 'DbReportLocation' => 50, 'DbReportOrganization' => 51, 'DbSubject' => 52, 'DbContributor' => 53, 'DbLanguage' => 54, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbGunid' => 1, 'dbName' => 2, 'dbMime' => 3, 'dbFtype' => 4, 'dbDirectory' => 5, 'dbFilepath' => 6, 'dbState' => 7, 'dbCurrentlyaccessing' => 8, 'dbEditedby' => 9, 'dbMtime' => 10, 'dbMd5' => 11, 'dbTrackTitle' => 12, 'dbArtistName' => 13, 'dbBitRate' => 14, 'dbSampleRate' => 15, 'dbFormat' => 16, 'dbLength' => 17, 'dbAlbumTitle' => 18, 'dbGenre' => 19, 'dbComments' => 20, 'dbYear' => 21, 'dbTrackNumber' => 22, 'dbChannels' => 23, 'dbUrl' => 24, 'dbBpm' => 25, 'dbRating' => 26, 'dbEncodedBy' => 27, 'dbDiscNumber' => 28, 'dbMood' => 29, 'dbLabel' => 30, 'dbComposer' => 31, 'dbEncoder' => 32, 'dbChecksum' => 33, 'dbLyrics' => 34, 'dbOrchestra' => 35, 'dbConductor' => 36, 'dbLyricist' => 37, 'dbOriginalLyricist' => 38, 'dbRadioStationName' => 39, 'dbInfoUrl' => 40, 'dbArtistUrl' => 41, 'dbAudioSourceUrl' => 42, 'dbRadioStationUrl' => 43, 'dbBuyThisUrl' => 44, 'dbIsrcNumber' => 45, 'dbCatalogNumber' => 46, 'dbOriginalArtist' => 47, 'dbCopyright' => 48, 'dbReportDatetime' => 49, 'dbReportLocation' => 50, 'dbReportOrganization' => 51, 'dbSubject' => 52, 'dbContributor' => 53, 'dbLanguage' => 54, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::GUNID => 1, self::NAME => 2, self::MIME => 3, self::FTYPE => 4, self::DIRECTORY => 5, self::FILEPATH => 6, self::STATE => 7, self::CURRENTLYACCESSING => 8, self::EDITEDBY => 9, self::MTIME => 10, self::MD5 => 11, self::TRACK_TITLE => 12, self::ARTIST_NAME => 13, self::BIT_RATE => 14, self::SAMPLE_RATE => 15, self::FORMAT => 16, self::LENGTH => 17, self::ALBUM_TITLE => 18, self::GENRE => 19, self::COMMENTS => 20, self::YEAR => 21, self::TRACK_NUMBER => 22, self::CHANNELS => 23, self::URL => 24, self::BPM => 25, self::RATING => 26, self::ENCODED_BY => 27, self::DISC_NUMBER => 28, self::MOOD => 29, self::LABEL => 30, self::COMPOSER => 31, self::ENCODER => 32, self::CHECKSUM => 33, self::LYRICS => 34, self::ORCHESTRA => 35, self::CONDUCTOR => 36, self::LYRICIST => 37, self::ORIGINAL_LYRICIST => 38, self::RADIO_STATION_NAME => 39, self::INFO_URL => 40, self::ARTIST_URL => 41, self::AUDIO_SOURCE_URL => 42, self::RADIO_STATION_URL => 43, self::BUY_THIS_URL => 44, self::ISRC_NUMBER => 45, self::CATALOG_NUMBER => 46, self::ORIGINAL_ARTIST => 47, self::COPYRIGHT => 48, self::REPORT_DATETIME => 49, self::REPORT_LOCATION => 50, self::REPORT_ORGANIZATION => 51, self::SUBJECT => 52, self::CONTRIBUTOR => 53, self::LANGUAGE => 54, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GUNID' => 1, 'NAME' => 2, 'MIME' => 3, 'FTYPE' => 4, 'DIRECTORY' => 5, 'FILEPATH' => 6, 'STATE' => 7, 'CURRENTLYACCESSING' => 8, 'EDITEDBY' => 9, 'MTIME' => 10, 'MD5' => 11, 'TRACK_TITLE' => 12, 'ARTIST_NAME' => 13, 'BIT_RATE' => 14, 'SAMPLE_RATE' => 15, 'FORMAT' => 16, 'LENGTH' => 17, 'ALBUM_TITLE' => 18, 'GENRE' => 19, 'COMMENTS' => 20, 'YEAR' => 21, 'TRACK_NUMBER' => 22, 'CHANNELS' => 23, 'URL' => 24, 'BPM' => 25, 'RATING' => 26, 'ENCODED_BY' => 27, 'DISC_NUMBER' => 28, 'MOOD' => 29, 'LABEL' => 30, 'COMPOSER' => 31, 'ENCODER' => 32, 'CHECKSUM' => 33, 'LYRICS' => 34, 'ORCHESTRA' => 35, 'CONDUCTOR' => 36, 'LYRICIST' => 37, 'ORIGINAL_LYRICIST' => 38, 'RADIO_STATION_NAME' => 39, 'INFO_URL' => 40, 'ARTIST_URL' => 41, 'AUDIO_SOURCE_URL' => 42, 'RADIO_STATION_URL' => 43, 'BUY_THIS_URL' => 44, 'ISRC_NUMBER' => 45, 'CATALOG_NUMBER' => 46, 'ORIGINAL_ARTIST' => 47, 'COPYRIGHT' => 48, 'REPORT_DATETIME' => 49, 'REPORT_LOCATION' => 50, 'REPORT_ORGANIZATION' => 51, 'SUBJECT' => 52, 'CONTRIBUTOR' => 53, 'LANGUAGE' => 54, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'gunid' => 1, 'name' => 2, 'mime' => 3, 'ftype' => 4, 'directory' => 5, 'filepath' => 6, 'state' => 7, 'currentlyaccessing' => 8, 'editedby' => 9, 'mtime' => 10, 'md5' => 11, 'track_title' => 12, 'artist_name' => 13, 'bit_rate' => 14, 'sample_rate' => 15, 'format' => 16, 'length' => 17, 'album_title' => 18, 'genre' => 19, 'comments' => 20, 'year' => 21, 'track_number' => 22, 'channels' => 23, 'url' => 24, 'bpm' => 25, 'rating' => 26, 'encoded_by' => 27, 'disc_number' => 28, 'mood' => 29, 'label' => 30, 'composer' => 31, 'encoder' => 32, 'checksum' => 33, 'lyrics' => 34, 'orchestra' => 35, 'conductor' => 36, 'lyricist' => 37, 'original_lyricist' => 38, 'radio_station_name' => 39, 'info_url' => 40, 'artist_url' => 41, 'audio_source_url' => 42, 'radio_station_url' => 43, 'buy_this_url' => 44, 'isrc_number' => 45, 'catalog_number' => 46, 'original_artist' => 47, 'copyright' => 48, 'report_datetime' => 49, 'report_location' => 50, 'report_organization' => 51, 'subject' => 52, 'contributor' => 53, 'language' => 54, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbGunid' => 1, 'DbName' => 2, 'DbMime' => 3, 'DbFtype' => 4, 'DbDirectory' => 5, 'DbFilepath' => 6, 'DbState' => 7, 'DbCurrentlyaccessing' => 8, 'DbEditedby' => 9, 'DbMtime' => 10, 'DbMd5' => 11, 'DbTrackTitle' => 12, 'DbArtistName' => 13, 'DbBitRate' => 14, 'DbSampleRate' => 15, 'DbFormat' => 16, 'DbLength' => 17, 'DbAlbumTitle' => 18, 'DbGenre' => 19, 'DbComments' => 20, 'DbYear' => 21, 'DbTrackNumber' => 22, 'DbChannels' => 23, 'DbUrl' => 24, 'DbBpm' => 25, 'DbRating' => 26, 'DbEncodedBy' => 27, 'DbDiscNumber' => 28, 'DbMood' => 29, 'DbLabel' => 30, 'DbComposer' => 31, 'DbEncoder' => 32, 'DbChecksum' => 33, 'DbLyrics' => 34, 'DbOrchestra' => 35, 'DbConductor' => 36, 'DbLyricist' => 37, 'DbOriginalLyricist' => 38, 'DbRadioStationName' => 39, 'DbInfoUrl' => 40, 'DbArtistUrl' => 41, 'DbAudioSourceUrl' => 42, 'DbRadioStationUrl' => 43, 'DbBuyThisUrl' => 44, 'DbIsrcNumber' => 45, 'DbCatalogNumber' => 46, 'DbOriginalArtist' => 47, 'DbCopyright' => 48, 'DbReportDatetime' => 49, 'DbReportLocation' => 50, 'DbReportOrganization' => 51, 'DbSubject' => 52, 'DbContributor' => 53, 'DbLanguage' => 54, 'DbSoundcloudId' => 55, 'DbSoundcloudErrorCode' => 56, 'DbSoundcloudErrorMsg' => 57, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbGunid' => 1, 'dbName' => 2, 'dbMime' => 3, 'dbFtype' => 4, 'dbDirectory' => 5, 'dbFilepath' => 6, 'dbState' => 7, 'dbCurrentlyaccessing' => 8, 'dbEditedby' => 9, 'dbMtime' => 10, 'dbMd5' => 11, 'dbTrackTitle' => 12, 'dbArtistName' => 13, 'dbBitRate' => 14, 'dbSampleRate' => 15, 'dbFormat' => 16, 'dbLength' => 17, 'dbAlbumTitle' => 18, 'dbGenre' => 19, 'dbComments' => 20, 'dbYear' => 21, 'dbTrackNumber' => 22, 'dbChannels' => 23, 'dbUrl' => 24, 'dbBpm' => 25, 'dbRating' => 26, 'dbEncodedBy' => 27, 'dbDiscNumber' => 28, 'dbMood' => 29, 'dbLabel' => 30, 'dbComposer' => 31, 'dbEncoder' => 32, 'dbChecksum' => 33, 'dbLyrics' => 34, 'dbOrchestra' => 35, 'dbConductor' => 36, 'dbLyricist' => 37, 'dbOriginalLyricist' => 38, 'dbRadioStationName' => 39, 'dbInfoUrl' => 40, 'dbArtistUrl' => 41, 'dbAudioSourceUrl' => 42, 'dbRadioStationUrl' => 43, 'dbBuyThisUrl' => 44, 'dbIsrcNumber' => 45, 'dbCatalogNumber' => 46, 'dbOriginalArtist' => 47, 'dbCopyright' => 48, 'dbReportDatetime' => 49, 'dbReportLocation' => 50, 'dbReportOrganization' => 51, 'dbSubject' => 52, 'dbContributor' => 53, 'dbLanguage' => 54, 'dbSoundcloudId' => 55, 'dbSoundcloudErrorCode' => 56, 'dbSoundcloudErrorMsg' => 57, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::GUNID => 1, self::NAME => 2, self::MIME => 3, self::FTYPE => 4, self::DIRECTORY => 5, self::FILEPATH => 6, self::STATE => 7, self::CURRENTLYACCESSING => 8, self::EDITEDBY => 9, self::MTIME => 10, self::MD5 => 11, self::TRACK_TITLE => 12, self::ARTIST_NAME => 13, self::BIT_RATE => 14, self::SAMPLE_RATE => 15, self::FORMAT => 16, self::LENGTH => 17, self::ALBUM_TITLE => 18, self::GENRE => 19, self::COMMENTS => 20, self::YEAR => 21, self::TRACK_NUMBER => 22, self::CHANNELS => 23, self::URL => 24, self::BPM => 25, self::RATING => 26, self::ENCODED_BY => 27, self::DISC_NUMBER => 28, self::MOOD => 29, self::LABEL => 30, self::COMPOSER => 31, self::ENCODER => 32, self::CHECKSUM => 33, self::LYRICS => 34, self::ORCHESTRA => 35, self::CONDUCTOR => 36, self::LYRICIST => 37, self::ORIGINAL_LYRICIST => 38, self::RADIO_STATION_NAME => 39, self::INFO_URL => 40, self::ARTIST_URL => 41, self::AUDIO_SOURCE_URL => 42, self::RADIO_STATION_URL => 43, self::BUY_THIS_URL => 44, self::ISRC_NUMBER => 45, self::CATALOG_NUMBER => 46, self::ORIGINAL_ARTIST => 47, self::COPYRIGHT => 48, self::REPORT_DATETIME => 49, self::REPORT_LOCATION => 50, self::REPORT_ORGANIZATION => 51, self::SUBJECT => 52, self::CONTRIBUTOR => 53, self::LANGUAGE => 54, self::SOUNDCLOUD_ID => 55, self::SOUNDCLOUD_ERROR_CODE => 56, self::SOUNDCLOUD_ERROR_MSG => 57, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GUNID' => 1, 'NAME' => 2, 'MIME' => 3, 'FTYPE' => 4, 'DIRECTORY' => 5, 'FILEPATH' => 6, 'STATE' => 7, 'CURRENTLYACCESSING' => 8, 'EDITEDBY' => 9, 'MTIME' => 10, 'MD5' => 11, 'TRACK_TITLE' => 12, 'ARTIST_NAME' => 13, 'BIT_RATE' => 14, 'SAMPLE_RATE' => 15, 'FORMAT' => 16, 'LENGTH' => 17, 'ALBUM_TITLE' => 18, 'GENRE' => 19, 'COMMENTS' => 20, 'YEAR' => 21, 'TRACK_NUMBER' => 22, 'CHANNELS' => 23, 'URL' => 24, 'BPM' => 25, 'RATING' => 26, 'ENCODED_BY' => 27, 'DISC_NUMBER' => 28, 'MOOD' => 29, 'LABEL' => 30, 'COMPOSER' => 31, 'ENCODER' => 32, 'CHECKSUM' => 33, 'LYRICS' => 34, 'ORCHESTRA' => 35, 'CONDUCTOR' => 36, 'LYRICIST' => 37, 'ORIGINAL_LYRICIST' => 38, 'RADIO_STATION_NAME' => 39, 'INFO_URL' => 40, 'ARTIST_URL' => 41, 'AUDIO_SOURCE_URL' => 42, 'RADIO_STATION_URL' => 43, 'BUY_THIS_URL' => 44, 'ISRC_NUMBER' => 45, 'CATALOG_NUMBER' => 46, 'ORIGINAL_ARTIST' => 47, 'COPYRIGHT' => 48, 'REPORT_DATETIME' => 49, 'REPORT_LOCATION' => 50, 'REPORT_ORGANIZATION' => 51, 'SUBJECT' => 52, 'CONTRIBUTOR' => 53, 'LANGUAGE' => 54, 'SOUNDCLOUD_ID' => 55, 'SOUNDCLOUD_ERROR_CODE' => 56, 'SOUNDCLOUD_ERROR_MSG' => 57, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'gunid' => 1, 'name' => 2, 'mime' => 3, 'ftype' => 4, 'directory' => 5, 'filepath' => 6, 'state' => 7, 'currentlyaccessing' => 8, 'editedby' => 9, 'mtime' => 10, 'md5' => 11, 'track_title' => 12, 'artist_name' => 13, 'bit_rate' => 14, 'sample_rate' => 15, 'format' => 16, 'length' => 17, 'album_title' => 18, 'genre' => 19, 'comments' => 20, 'year' => 21, 'track_number' => 22, 'channels' => 23, 'url' => 24, 'bpm' => 25, 'rating' => 26, 'encoded_by' => 27, 'disc_number' => 28, 'mood' => 29, 'label' => 30, 'composer' => 31, 'encoder' => 32, 'checksum' => 33, 'lyrics' => 34, 'orchestra' => 35, 'conductor' => 36, 'lyricist' => 37, 'original_lyricist' => 38, 'radio_station_name' => 39, 'info_url' => 40, 'artist_url' => 41, 'audio_source_url' => 42, 'radio_station_url' => 43, 'buy_this_url' => 44, 'isrc_number' => 45, 'catalog_number' => 46, 'original_artist' => 47, 'copyright' => 48, 'report_datetime' => 49, 'report_location' => 50, 'report_organization' => 51, 'subject' => 52, 'contributor' => 53, 'language' => 54, 'soundcloud_id' => 55, 'soundcloud_error_code' => 56, 'soundcloud_error_msg' => 57, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, )
);
/**
@ -359,6 +368,9 @@ abstract class BaseCcFilesPeer {
$criteria->addSelectColumn(CcFilesPeer::SUBJECT);
$criteria->addSelectColumn(CcFilesPeer::CONTRIBUTOR);
$criteria->addSelectColumn(CcFilesPeer::LANGUAGE);
$criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ID);
$criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ERROR_CODE);
$criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ERROR_MSG);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.GUNID');
@ -415,6 +427,9 @@ abstract class BaseCcFilesPeer {
$criteria->addSelectColumn($alias . '.SUBJECT');
$criteria->addSelectColumn($alias . '.CONTRIBUTOR');
$criteria->addSelectColumn($alias . '.LANGUAGE');
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_ID');
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_ERROR_CODE');
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_ERROR_MSG');
}
}

View File

@ -61,6 +61,9 @@
* @method CcFilesQuery orderByDbSubject($order = Criteria::ASC) Order by the subject column
* @method CcFilesQuery orderByDbContributor($order = Criteria::ASC) Order by the contributor column
* @method CcFilesQuery orderByDbLanguage($order = Criteria::ASC) Order by the language column
* @method CcFilesQuery orderByDbSoundcloudId($order = Criteria::ASC) Order by the soundcloud_id column
* @method CcFilesQuery orderByDbSoundcloudErrorCode($order = Criteria::ASC) Order by the soundcloud_error_code column
* @method CcFilesQuery orderByDbSoundcloudErrorMsg($order = Criteria::ASC) Order by the soundcloud_error_msg column
*
* @method CcFilesQuery groupByDbId() Group by the id column
* @method CcFilesQuery groupByDbGunid() Group by the gunid column
@ -117,6 +120,9 @@
* @method CcFilesQuery groupByDbSubject() Group by the subject column
* @method CcFilesQuery groupByDbContributor() Group by the contributor column
* @method CcFilesQuery groupByDbLanguage() Group by the language column
* @method CcFilesQuery groupByDbSoundcloudId() Group by the soundcloud_id column
* @method CcFilesQuery groupByDbSoundcloudErrorCode() Group by the soundcloud_error_code column
* @method CcFilesQuery groupByDbSoundcloudErrorMsg() Group by the soundcloud_error_msg column
*
* @method CcFilesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcFilesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -200,6 +206,9 @@
* @method CcFiles findOneByDbSubject(string $subject) Return the first CcFiles filtered by the subject column
* @method CcFiles findOneByDbContributor(string $contributor) Return the first CcFiles filtered by the contributor column
* @method CcFiles findOneByDbLanguage(string $language) Return the first CcFiles filtered by the language column
* @method CcFiles findOneByDbSoundcloudId(int $soundcloud_id) Return the first CcFiles filtered by the soundcloud_id column
* @method CcFiles findOneByDbSoundcloudErrorCode(int $soundcloud_error_code) Return the first CcFiles filtered by the soundcloud_error_code column
* @method CcFiles findOneByDbSoundcloudErrorMsg(string $soundcloud_error_msg) Return the first CcFiles filtered by the soundcloud_error_msg column
*
* @method array findByDbId(int $id) Return CcFiles objects filtered by the id column
* @method array findByDbGunid(string $gunid) Return CcFiles objects filtered by the gunid column
@ -256,6 +265,9 @@
* @method array findByDbSubject(string $subject) Return CcFiles objects filtered by the subject column
* @method array findByDbContributor(string $contributor) Return CcFiles objects filtered by the contributor column
* @method array findByDbLanguage(string $language) Return CcFiles objects filtered by the language column
* @method array findByDbSoundcloudId(int $soundcloud_id) Return CcFiles objects filtered by the soundcloud_id column
* @method array findByDbSoundcloudErrorCode(int $soundcloud_error_code) Return CcFiles objects filtered by the soundcloud_error_code column
* @method array findByDbSoundcloudErrorMsg(string $soundcloud_error_msg) Return CcFiles objects filtered by the soundcloud_error_msg column
*
* @package propel.generator.airtime.om
*/
@ -1633,6 +1645,90 @@ abstract class BaseCcFilesQuery extends ModelCriteria
return $this->addUsingAlias(CcFilesPeer::LANGUAGE, $dbLanguage, $comparison);
}
/**
* Filter the query on the soundcloud_id column
*
* @param int|array $dbSoundcloudId The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcFilesQuery The current query, for fluid interface
*/
public function filterByDbSoundcloudId($dbSoundcloudId = null, $comparison = null)
{
if (is_array($dbSoundcloudId)) {
$useMinMax = false;
if (isset($dbSoundcloudId['min'])) {
$this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ID, $dbSoundcloudId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbSoundcloudId['max'])) {
$this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ID, $dbSoundcloudId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ID, $dbSoundcloudId, $comparison);
}
/**
* Filter the query on the soundcloud_error_code column
*
* @param int|array $dbSoundcloudErrorCode The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcFilesQuery The current query, for fluid interface
*/
public function filterByDbSoundcloudErrorCode($dbSoundcloudErrorCode = null, $comparison = null)
{
if (is_array($dbSoundcloudErrorCode)) {
$useMinMax = false;
if (isset($dbSoundcloudErrorCode['min'])) {
$this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $dbSoundcloudErrorCode['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbSoundcloudErrorCode['max'])) {
$this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $dbSoundcloudErrorCode['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $dbSoundcloudErrorCode, $comparison);
}
/**
* Filter the query on the soundcloud_error_msg column
*
* @param string $dbSoundcloudErrorMsg The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcFilesQuery The current query, for fluid interface
*/
public function filterByDbSoundcloudErrorMsg($dbSoundcloudErrorMsg = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbSoundcloudErrorMsg)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbSoundcloudErrorMsg)) {
$dbSoundcloudErrorMsg = str_replace('*', '%', $dbSoundcloudErrorMsg);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_MSG, $dbSoundcloudErrorMsg, $comparison);
}
/**
* Filter the query by a related CcSubjs object
*

View File

@ -74,12 +74,6 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
*/
protected $file_id;
/**
* The value for the soundcloud_id field.
* @var int
*/
protected $soundcloud_id;
/**
* The value for the time_filled field.
* @var string
@ -273,16 +267,6 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
return $this->file_id;
}
/**
* Get the [soundcloud_id] column value.
*
* @return int
*/
public function getDbSoundCloudId()
{
return $this->soundcloud_id;
}
/**
* Get the [optionally formatted] temporal [time_filled] column value.
*
@ -546,26 +530,6 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
return $this;
} // setDbRecordedFile()
/**
* Set the value of [soundcloud_id] column.
*
* @param int $v new value
* @return CcShowInstances The current object (for fluent API support)
*/
public function setDbSoundCloudId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->soundcloud_id !== $v) {
$this->soundcloud_id = $v;
$this->modifiedColumns[] = CcShowInstancesPeer::SOUNDCLOUD_ID;
}
return $this;
} // setDbSoundCloudId()
/**
* Sets the value of [time_filled] column to a normalized version of the date/time value specified.
*
@ -663,8 +627,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->rebroadcast = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
$this->instance_id = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
$this->file_id = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
$this->soundcloud_id = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
$this->time_filled = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
$this->time_filled = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
$this->resetModified();
$this->setNew(false);
@ -673,7 +636,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->ensureConsistency();
}
return $startcol + 10; // 10 = CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 9; // 9 = CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcShowInstances object", $e);
@ -1095,9 +1058,6 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
return $this->getDbRecordedFile();
break;
case 8:
return $this->getDbSoundCloudId();
break;
case 9:
return $this->getDbTimeFilled();
break;
default:
@ -1132,8 +1092,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$keys[5] => $this->getDbRebroadcast(),
$keys[6] => $this->getDbOriginalShow(),
$keys[7] => $this->getDbRecordedFile(),
$keys[8] => $this->getDbSoundCloudId(),
$keys[9] => $this->getDbTimeFilled(),
$keys[8] => $this->getDbTimeFilled(),
);
if ($includeForeignObjects) {
if (null !== $this->aCcShow) {
@ -1201,9 +1160,6 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->setDbRecordedFile($value);
break;
case 8:
$this->setDbSoundCloudId($value);
break;
case 9:
$this->setDbTimeFilled($value);
break;
} // switch()
@ -1238,8 +1194,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
if (array_key_exists($keys[5], $arr)) $this->setDbRebroadcast($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDbOriginalShow($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDbRecordedFile($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setDbSoundCloudId($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setDbTimeFilled($arr[$keys[9]]);
if (array_key_exists($keys[8], $arr)) $this->setDbTimeFilled($arr[$keys[8]]);
}
/**
@ -1259,7 +1214,6 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
if ($this->isColumnModified(CcShowInstancesPeer::REBROADCAST)) $criteria->add(CcShowInstancesPeer::REBROADCAST, $this->rebroadcast);
if ($this->isColumnModified(CcShowInstancesPeer::INSTANCE_ID)) $criteria->add(CcShowInstancesPeer::INSTANCE_ID, $this->instance_id);
if ($this->isColumnModified(CcShowInstancesPeer::FILE_ID)) $criteria->add(CcShowInstancesPeer::FILE_ID, $this->file_id);
if ($this->isColumnModified(CcShowInstancesPeer::SOUNDCLOUD_ID)) $criteria->add(CcShowInstancesPeer::SOUNDCLOUD_ID, $this->soundcloud_id);
if ($this->isColumnModified(CcShowInstancesPeer::TIME_FILLED)) $criteria->add(CcShowInstancesPeer::TIME_FILLED, $this->time_filled);
return $criteria;
@ -1329,7 +1283,6 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$copyObj->setDbRebroadcast($this->rebroadcast);
$copyObj->setDbOriginalShow($this->instance_id);
$copyObj->setDbRecordedFile($this->file_id);
$copyObj->setDbSoundCloudId($this->soundcloud_id);
$copyObj->setDbTimeFilled($this->time_filled);
if ($deepCopy) {
@ -1847,7 +1800,6 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->rebroadcast = null;
$this->instance_id = null;
$this->file_id = null;
$this->soundcloud_id = null;
$this->time_filled = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;

View File

@ -26,7 +26,7 @@ abstract class BaseCcShowInstancesPeer {
const TM_CLASS = 'CcShowInstancesTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 10;
const NUM_COLUMNS = 9;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@ -55,9 +55,6 @@ abstract class BaseCcShowInstancesPeer {
/** the column name for the FILE_ID field */
const FILE_ID = 'cc_show_instances.FILE_ID';
/** the column name for the SOUNDCLOUD_ID field */
const SOUNDCLOUD_ID = 'cc_show_instances.SOUNDCLOUD_ID';
/** the column name for the TIME_FILLED field */
const TIME_FILLED = 'cc_show_instances.TIME_FILLED';
@ -77,12 +74,12 @@ abstract class BaseCcShowInstancesPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', 'DbRecord', 'DbRebroadcast', 'DbOriginalShow', 'DbRecordedFile', 'DbSoundCloudId', 'DbTimeFilled', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', 'dbRecord', 'dbRebroadcast', 'dbOriginalShow', 'dbRecordedFile', 'dbSoundCloudId', 'dbTimeFilled', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::SHOW_ID, self::RECORD, self::REBROADCAST, self::INSTANCE_ID, self::FILE_ID, self::SOUNDCLOUD_ID, self::TIME_FILLED, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', 'RECORD', 'REBROADCAST', 'INSTANCE_ID', 'FILE_ID', 'SOUNDCLOUD_ID', 'TIME_FILLED', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', 'record', 'rebroadcast', 'instance_id', 'file_id', 'soundcloud_id', 'time_filled', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', 'DbRecord', 'DbRebroadcast', 'DbOriginalShow', 'DbRecordedFile', 'DbTimeFilled', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', 'dbRecord', 'dbRebroadcast', 'dbOriginalShow', 'dbRecordedFile', 'dbTimeFilled', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::SHOW_ID, self::RECORD, self::REBROADCAST, self::INSTANCE_ID, self::FILE_ID, self::TIME_FILLED, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', 'RECORD', 'REBROADCAST', 'INSTANCE_ID', 'FILE_ID', 'TIME_FILLED', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', 'record', 'rebroadcast', 'instance_id', 'file_id', 'time_filled', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
/**
@ -92,12 +89,12 @@ abstract class BaseCcShowInstancesPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbShowId' => 3, 'DbRecord' => 4, 'DbRebroadcast' => 5, 'DbOriginalShow' => 6, 'DbRecordedFile' => 7, 'DbSoundCloudId' => 8, 'DbTimeFilled' => 9, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, 'dbRecord' => 4, 'dbRebroadcast' => 5, 'dbOriginalShow' => 6, 'dbRecordedFile' => 7, 'dbSoundCloudId' => 8, 'dbTimeFilled' => 9, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::SHOW_ID => 3, self::RECORD => 4, self::REBROADCAST => 5, self::INSTANCE_ID => 6, self::FILE_ID => 7, self::SOUNDCLOUD_ID => 8, self::TIME_FILLED => 9, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'SHOW_ID' => 3, 'RECORD' => 4, 'REBROADCAST' => 5, 'INSTANCE_ID' => 6, 'FILE_ID' => 7, 'SOUNDCLOUD_ID' => 8, 'TIME_FILLED' => 9, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'show_id' => 3, 'record' => 4, 'rebroadcast' => 5, 'instance_id' => 6, 'file_id' => 7, 'soundcloud_id' => 8, 'time_filled' => 9, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbShowId' => 3, 'DbRecord' => 4, 'DbRebroadcast' => 5, 'DbOriginalShow' => 6, 'DbRecordedFile' => 7, 'DbTimeFilled' => 8, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, 'dbRecord' => 4, 'dbRebroadcast' => 5, 'dbOriginalShow' => 6, 'dbRecordedFile' => 7, 'dbTimeFilled' => 8, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::SHOW_ID => 3, self::RECORD => 4, self::REBROADCAST => 5, self::INSTANCE_ID => 6, self::FILE_ID => 7, self::TIME_FILLED => 8, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'SHOW_ID' => 3, 'RECORD' => 4, 'REBROADCAST' => 5, 'INSTANCE_ID' => 6, 'FILE_ID' => 7, 'TIME_FILLED' => 8, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'show_id' => 3, 'record' => 4, 'rebroadcast' => 5, 'instance_id' => 6, 'file_id' => 7, 'time_filled' => 8, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
/**
@ -177,7 +174,6 @@ abstract class BaseCcShowInstancesPeer {
$criteria->addSelectColumn(CcShowInstancesPeer::REBROADCAST);
$criteria->addSelectColumn(CcShowInstancesPeer::INSTANCE_ID);
$criteria->addSelectColumn(CcShowInstancesPeer::FILE_ID);
$criteria->addSelectColumn(CcShowInstancesPeer::SOUNDCLOUD_ID);
$criteria->addSelectColumn(CcShowInstancesPeer::TIME_FILLED);
} else {
$criteria->addSelectColumn($alias . '.ID');
@ -188,7 +184,6 @@ abstract class BaseCcShowInstancesPeer {
$criteria->addSelectColumn($alias . '.REBROADCAST');
$criteria->addSelectColumn($alias . '.INSTANCE_ID');
$criteria->addSelectColumn($alias . '.FILE_ID');
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_ID');
$criteria->addSelectColumn($alias . '.TIME_FILLED');
}
}

View File

@ -14,7 +14,6 @@
* @method CcShowInstancesQuery orderByDbRebroadcast($order = Criteria::ASC) Order by the rebroadcast column
* @method CcShowInstancesQuery orderByDbOriginalShow($order = Criteria::ASC) Order by the instance_id column
* @method CcShowInstancesQuery orderByDbRecordedFile($order = Criteria::ASC) Order by the file_id column
* @method CcShowInstancesQuery orderByDbSoundCloudId($order = Criteria::ASC) Order by the soundcloud_id column
* @method CcShowInstancesQuery orderByDbTimeFilled($order = Criteria::ASC) Order by the time_filled column
*
* @method CcShowInstancesQuery groupByDbId() Group by the id column
@ -25,7 +24,6 @@
* @method CcShowInstancesQuery groupByDbRebroadcast() Group by the rebroadcast column
* @method CcShowInstancesQuery groupByDbOriginalShow() Group by the instance_id column
* @method CcShowInstancesQuery groupByDbRecordedFile() Group by the file_id column
* @method CcShowInstancesQuery groupByDbSoundCloudId() Group by the soundcloud_id column
* @method CcShowInstancesQuery groupByDbTimeFilled() Group by the time_filled column
*
* @method CcShowInstancesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
@ -63,7 +61,6 @@
* @method CcShowInstances findOneByDbRebroadcast(int $rebroadcast) Return the first CcShowInstances filtered by the rebroadcast column
* @method CcShowInstances findOneByDbOriginalShow(int $instance_id) Return the first CcShowInstances filtered by the instance_id column
* @method CcShowInstances findOneByDbRecordedFile(int $file_id) Return the first CcShowInstances filtered by the file_id column
* @method CcShowInstances findOneByDbSoundCloudId(int $soundcloud_id) Return the first CcShowInstances filtered by the soundcloud_id column
* @method CcShowInstances findOneByDbTimeFilled(string $time_filled) Return the first CcShowInstances filtered by the time_filled column
*
* @method array findByDbId(int $id) Return CcShowInstances objects filtered by the id column
@ -74,7 +71,6 @@
* @method array findByDbRebroadcast(int $rebroadcast) Return CcShowInstances objects filtered by the rebroadcast column
* @method array findByDbOriginalShow(int $instance_id) Return CcShowInstances objects filtered by the instance_id column
* @method array findByDbRecordedFile(int $file_id) Return CcShowInstances objects filtered by the file_id column
* @method array findByDbSoundCloudId(int $soundcloud_id) Return CcShowInstances objects filtered by the soundcloud_id column
* @method array findByDbTimeFilled(string $time_filled) Return CcShowInstances objects filtered by the time_filled column
*
* @package propel.generator.airtime.om
@ -419,37 +415,6 @@ abstract class BaseCcShowInstancesQuery extends ModelCriteria
return $this->addUsingAlias(CcShowInstancesPeer::FILE_ID, $dbRecordedFile, $comparison);
}
/**
* Filter the query on the soundcloud_id column
*
* @param int|array $dbSoundCloudId The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowInstancesQuery The current query, for fluid interface
*/
public function filterByDbSoundCloudId($dbSoundCloudId = null, $comparison = null)
{
if (is_array($dbSoundCloudId)) {
$useMinMax = false;
if (isset($dbSoundCloudId['min'])) {
$this->addUsingAlias(CcShowInstancesPeer::SOUNDCLOUD_ID, $dbSoundCloudId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbSoundCloudId['max'])) {
$this->addUsingAlias(CcShowInstancesPeer::SOUNDCLOUD_ID, $dbSoundCloudId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcShowInstancesPeer::SOUNDCLOUD_ID, $dbSoundCloudId, $comparison);
}
/**
* Filter the query on the time_filled column
*

View File

@ -1,6 +1,6 @@
#Note: project.home is automatically generated by the propel-install script.
#Any manual changes to this value will be overwritten.
project.home = /home/martin/workspace/airtime/airtime_mvc
project.home = /home/james/src/airtime/airtime_mvc
project.build = ${project.home}/build
#Database driver

View File

@ -88,6 +88,9 @@
<column name="subject" phpName="DbSubject" type="VARCHAR" size="512" required="false"/>
<column name="contributor" phpName="DbContributor" type="VARCHAR" size="512" required="false"/>
<column name="language" phpName="DbLanguage" type="VARCHAR" size="512" required="false"/>
<column name="soundcloud_id" phpName="DbSoundcloudId" type="Integer" required="false"/>
<column name="soundcloud_error_code" phpName="DbSoundcloudErrorCode" type="Integer" required="false"/>
<column name="soundcloud_error_msg" phpName="DbSoundcloudErrorMsg" type="VARCHAR" size="512" required="false"/>
<foreign-key foreignTable="cc_subjs" name="cc_files_editedby_fkey">
<reference local="editedby" foreign="id"/>
</foreign-key>
@ -144,7 +147,6 @@
<column name="rebroadcast" phpName="DbRebroadcast" type="TINYINT" required="false" defaultValue="0"/>
<column name="instance_id" phpName="DbOriginalShow" type="INTEGER" required="false"/>
<column name="file_id" phpName="DbRecordedFile" type="INTEGER" required="false"/>
<column name="soundcloud_id" phpName="DbSoundCloudId" type="INTEGER" required="false"/>
<column name="time_filled" phpName="DbTimeFilled" type="TIME" />
<behavior name="aggregate_column">
<parameter name="name" value="time_filled" />

View File

@ -114,6 +114,9 @@ CREATE TABLE "cc_files"
"subject" VARCHAR(512),
"contributor" VARCHAR(512),
"language" VARCHAR(512),
"soundcloud_id" INTEGER,
"soundcloud_error_code" INTEGER,
"soundcloud_error_msg" VARCHAR(512),
PRIMARY KEY ("id"),
CONSTRAINT "cc_files_gunid_idx" UNIQUE ("gunid")
);
@ -191,7 +194,6 @@ CREATE TABLE "cc_show_instances"
"rebroadcast" INT2 default 0,
"instance_id" INTEGER,
"file_id" INTEGER,
"soundcloud_id" INTEGER,
"time_filled" TIME,
PRIMARY KEY ("id")
);
@ -509,7 +511,7 @@ DROP TABLE "cc_component" CASCADE;
CREATE TABLE "cc_component"
(
"name" VARCHAR(32) NOT NULL,
"ip" VARCHAR(32) NOT NULL,
"ip" VARCHAR(18) NOT NULL,
PRIMARY KEY ("name")
);

File diff suppressed because one or more lines are too long

View File

@ -1566,6 +1566,9 @@ div.success{
background:url(images/icon_soundcloud.png) no-repeat 0 0;
width:21px;
}
.small-icon.sc-error {
background:url(images/icon_record.png) no-repeat 0 0;
}
.small-icon.progress {
background:url(images/upload-icon.gif) no-repeat;
background-color:black;

View File

@ -111,35 +111,40 @@ function dtRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
// insert id on lenth field
$('td:eq(4)', nRow).attr("id", "length");
$('td:eq(5) img', nRow).qtip({
content: {
url: '/Library/get-file-meta-data',
type: 'post',
data: ({format: "html", id : id, type: type}),
title: {
text: aData[1] + ' MetaData',
button: 'Close' // Show a close link in the title
}
},
position: {
adjust: {
screen: true // Keep the tooltip on-screen at all times
}
},
style: {
border: {
width: 0,
radius: 4
$('td:gt(0)', nRow).qtip({
content: {
text: "Loading...",
title: {
text: aData[1] + " MetaData"
},
ajax: {
url: "/Library/get-file-meta-data",
type: "post",
data: ({format: "html", id : id, type: type}),
success: function(data, status){
this.set('content.text', data)
}
}
},
name: 'dark', // Use the default light style
width: 570 // Set the tooltip width
}
});
position: {
adjust: {
resize: true,
method: "flip flip"
},
at: "right center",
my: "left top",
viewport: $(window)
},
style: {
width: 570,
classes: "ui-tooltip-dark"
},
show: {
delay: 700
}
}
);
return nRow;
}
@ -148,6 +153,105 @@ function dtDrawCallback() {
addLibraryItemEvents();
}
function redrawDataTable() {
var dt;
dt = $('#library_display').dataTable();
dt.fnDraw(false);
}
function checkSCUploadStatus(){
var url = '/Library/get-upload-to-sc-status/format/json';
$("span[class*=progress]").each(function(){
var id = $(this).attr("id");
$.post(url, {format: "json", id: id, type:"file"}, function(json){
if(json.sc_id > 0){
$("span[id="+id+"]").removeClass("progress").addClass("soundcloud");
}else if(json.sc_id == "-3"){
$("span[id="+id+"]").removeClass("progress").addClass("sc-error");
}
});
})
}
function addQtipToSCIcons(){
$(".progress, .soundcloud, .sc-error").live('mouseover', function(){
var id = $(this).attr("id");
if($(this).hasClass("progress")){
$(this).qtip({
content: {
text: "Uploading in the progress..."
},
position:{
adjust: {
resize: true,
method: "flip flip"
},
at: "right center",
my: "left top",
viewport: $(window)
},
show: {
ready: true // Needed to make it show on first mouseover event
}
})
}else if($(this).hasClass("soundcloud")){
$(this).qtip({
content: {
text: "Retreiving data from the server...",
ajax: {
url: "/Library/get-upload-to-sc-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
this.set('content.text', "The soundcloud id for this file is: "+json.sc_id)
}
}
},
position:{
adjust: {
resize: true,
method: "flip flip"
},
at: "right center",
my: "left top",
viewport: $(window)
},
show: {
ready: true // Needed to make it show on first mouseover event
}
})
}else if($(this).hasClass("sc-error")){
$(this).qtip({
content: {
text: "Retreiving data from the server...",
ajax: {
url: "/Library/get-upload-to-sc-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
this.set('content.text', "There was error while uploading to soundcloud.<br>"+"Error code: "+json.error_code+
"<br>"+"Error msg: "+json.error_msg+"<br>")
}
}
},
position:{
adjust: {
resize: true,
method: "flip flip"
},
at: "right center",
my: "left top",
viewport: $(window)
},
show: {
ready: true // Needed to make it show on first mouseover event
}
})
}
});
}
$(document).ready(function() {
$('.tabs').tabs();
@ -187,4 +291,7 @@ $(document).ready(function() {
checkImportStatus()
setInterval( "checkImportStatus()", 5000 );
setInterval( "checkSCUploadStatus()", 5000 );
addQtipToSCIcons()
});

View File

@ -221,34 +221,53 @@ function eventRender(event, element, view) {
}
//add the record/rebroadcast icons if needed.
//record icon (only if not on soundcloud, will always be true for future events)
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.record === 1 && event.soundcloud_id === -1) {
$(element).find(".fc-event-time").before('<span class="small-icon recording"></span>');
$(element).find(".fc-event-time").before('<span id="'+event.id+'" class="small-icon recording"></span>');
}
if(view.name === 'month' && event.record === 1 && event.soundcloud_id === -1) {
$(element).find(".fc-event-title").after('<span class="small-icon recording"></span>');
$(element).find(".fc-event-title").after('<span id="'+event.id+'" class="small-icon recording"></span>');
}
//rebroadcast icon
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.rebroadcast === 1) {
$(element).find(".fc-event-time").before('<span class="small-icon rebroadcast"></span>');
$(element).find(".fc-event-time").before('<span id="'+event.id+'" class="small-icon rebroadcast"></span>');
}
if(view.name === 'month' && event.rebroadcast === 1) {
$(element).find(".fc-event-title").after('<span class="small-icon rebroadcast"></span>');
$(element).find(".fc-event-title").after('<span id="'+event.id+'" class="small-icon rebroadcast"></span>');
}
//soundcloud icon
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.soundcloud_id !== -1 && event.record === 1) {
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.soundcloud_id > 0 && event.record === 1) {
$(element).find(".fc-event-time").before('<span class="small-icon soundcloud"></span>');
$(element).find(".fc-event-time").before('<span id="'+event.id+'" class="small-icon soundcloud"></span>');
}
if(view.name === 'month' && event.soundcloud_id !== -1 && event.record === 1) {
if(view.name === 'month' && event.soundcloud_id > 0 && event.record === 1) {
$(element).find(".fc-event-title").after('<span class="small-icon soundcloud"></span>');
$(element).find(".fc-event-title").after('<span id="'+event.id+'" class="small-icon soundcloud"></span>');
}
//progress icon
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.soundcloud_id === -2 && event.record === 1) {
$(element).find(".fc-event-time").before('<span id="'+event.id+'" class="small-icon progress"></span>');
}
if(view.name === 'month' && event.soundcloud_id === -2 && event.record === 1) {
$(element).find(".fc-event-title").after('<span id="'+event.id+'" class="small-icon progress"></span>');
}
//error icon
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.soundcloud_id === -3 && event.record === 1) {
$(element).find(".fc-event-time").before('<span id="'+event.id+'" class="small-icon sc-error"></span>');
}
if(view.name === 'month' && event.soundcloud_id === -3 && event.record === 1) {
$(element).find(".fc-event-title").after('<span id="'+event.id+'" class="small-icon sc-error"></span>');
}
}
function eventAfterRender( event, element, view ) {
@ -258,6 +277,9 @@ function eventAfterRender( event, element, view ) {
[{get:"/Schedule/make-context-menu/format/json/id/#id#"}],
{id: event.id},
{xposition: "mouse", yposition: "mouse"});
$(element).find(".small-icon").live('mouseover',function(){
addQtipToSCIcons($(this));
})
}
function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) {
@ -306,3 +328,97 @@ function getFullCalendarEvents(start, end, callback) {
callback(json.events);
});
}
function checkSCUploadStatus(){
var url = '/Library/get-upload-to-sc-status/format/json';
$("span[class*=progress]").each(function(){
var id = $(this).attr("id");
$.post(url, {format: "json", id: id, type:"show"}, function(json){
if(json.sc_id > 0){
$("span[id="+id+"]").removeClass("progress").addClass("soundcloud");
}else if(json.sc_id == "-3"){
$("span[id="+id+"]").removeClass("progress").addClass("sc-error");
}
});
})
}
function addQtipToSCIcons(ele){
var id = $(ele).attr("id");
if($(ele).hasClass("progress")){
$(ele).qtip({
content: {
text: "Uploading in the progress..."
},
position:{
adjust: {
resize: true,
method: "flip flip"
},
at: "right center",
my: "left top",
viewport: $(window)
},
show: {
ready: true // Needed to make it show on first mouseover event
}
})
}else if($(ele).hasClass("soundcloud")){
$(ele).qtip({
content: {
text: "Retreiving data from the server...",
ajax: {
url: "/Library/get-upload-to-sc-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
this.set('content.text', "The soundcloud id for this file is: "+json.sc_id)
}
}
},
position:{
adjust: {
resize: true,
method: "flip flip"
},
at: "right center",
my: "left top",
viewport: $(window)
},
show: {
ready: true // Needed to make it show on first mouseover event
}
})
}else if($(ele).hasClass("sc-error")){
$(ele).qtip({
content: {
text: "Retreiving data from the server...",
ajax: {
url: "/Library/get-upload-to-sc-status",
type: "post",
data: ({format: "json", id : id, type: "show"}),
success: function(json, status){
this.set('content.text', "There was error while uploading to soundcloud.<br>"+"Error code: "+json.error_code+
"<br>"+"Error msg: "+json.error_msg+"<br>")
}
}
},
position:{
adjust: {
resize: true,
method: "flip flip"
},
at: "right center",
my: "left top",
viewport: $(window)
},
show: {
ready: true // Needed to make it show on first mouseover event
}
})
}
}
$(document).ready(function(){
setInterval( "checkSCUploadStatus()", 5000 );
})

View File

@ -180,20 +180,19 @@ function uploadToSoundCloud(show_instance_id){
var url = "/Schedule/upload-to-sound-cloud";
var span = $(window.triggerElement).find(".recording");
span.removeClass("recording")
if(span.length == 0){
span = $(window.triggerElement).find(".soundcloud");
span.removeClass("soundcloud")
.addClass("progress")
}else{
span.removeClass("recording")
.addClass("progress");
}
$.post(url,
{id: show_instance_id, format: "json"},
function(data){
if(data.error) {
span.removeClass("progress")
.addClass("recording");
alert(data.error);
return;
}
function(){
scheduleRefetchEvents();
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

34
utils/soundcloud-uploader Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
#-------------------------------------------------------------------------------
# Copyright (c) 2011 Sourcefabric O.P.S.
#
# This file is part of the Airtime project.
# http://airtime.sourcefabric.org/
#
# Airtime is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Airtime is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Airtime; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# This script upload files to soundcloud
#
# Absolute path to this script
SCRIPT=`readlink -f $0`
# Absolute directory this script is in
SCRIPTPATH=`dirname $SCRIPT`
invokePwd=$PWD
cd $SCRIPTPATH
php -q soundcloud-uploader.php "$@" > /dev/null 2>&1 || exit 1

View File

@ -0,0 +1,66 @@
<?php
$values = parse_ini_file('/etc/airtime/airtime.conf', true);
// Name of the web server user
$CC_CONFIG['webServerUser'] = $values['general']['web_server_user'];
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
$CC_CONFIG['rabbitmq'] = $values['rabbitmq'];
$CC_CONFIG['baseUrl'] = $values['general']['base_url'];
$CC_CONFIG['basePort'] = $values['general']['base_port'];
// Database 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['soundcloud-connection-retries'] = $values['soundcloud']['connection_retries'];
$CC_CONFIG['soundcloud-connection-wait'] = $values['soundcloud']['time_between_retries'];
require_once($CC_CONFIG['phpDir'].'/application/configs/constants.php');
require_once($CC_CONFIG['phpDir'].'/application/configs/conf.php');
//$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
$CC_CONFIG['phpDir'] = "/home/james/src/airtime/airtime_mvc";
require_once($CC_CONFIG['phpDir'].'/application/models/StoredFile.php');
require_once($CC_CONFIG['phpDir'].'/application/models/Preference.php');
require_once($CC_CONFIG['phpDir'].'/application/models/MusicDir.php');
set_include_path($CC_CONFIG['phpDir'].'/library' . PATH_SEPARATOR . get_include_path());
require_once($CC_CONFIG['phpDir'].'/application/models/Soundcloud.php');
set_include_path($CC_CONFIG['phpDir']."/application/models" . PATH_SEPARATOR . get_include_path());
require_once($CC_CONFIG['phpDir']."/library/propel/runtime/lib/Propel.php");
Propel::init($CC_CONFIG['phpDir']."/application/configs/airtime-conf.php");
//Pear classes.
set_include_path($CC_CONFIG['phpDir'].'/library/pear' . PATH_SEPARATOR . get_include_path());
require_once('DB.php');
$CC_DBC = DB::connect($CC_CONFIG['dsn'], FALSE);
if (PEAR::isError($CC_DBC)) {
/*echo $CC_DBC->getMessage().PHP_EOL;
echo $CC_DBC->getUserInfo().PHP_EOL;
echo "Database connection problem.".PHP_EOL;
echo "Check if database '{$CC_CONFIG['dsn']['database']}' exists".
" with corresponding permissions.".PHP_EOL;*/
if ($p_exitOnError) {
exit(1);
}
} else {
//echo "* Connected to database".PHP_EOL;
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
}
if(count($argv) != 2){
exit;
}
$id = $argv[1];
$file = StoredFile::Recall($id);
// set id with -2 which is indicator for processing
$file->setSoundCloudFileId(-2);
$file->uploadToSoundCloud();