CC-2129 : Retry automatic upload to Soundcloud if Internet connection problem

configs for retry, id of soundcloud file is added to database.
This commit is contained in:
Naomi 2011-03-30 18:15:33 -04:00
parent d2fb99eff9
commit 85a984e669
12 changed files with 131 additions and 100 deletions

View File

@ -8,13 +8,6 @@ return array (
'BaseCcAccessPeer' => 'airtime/om/BaseCcAccessPeer.php', 'BaseCcAccessPeer' => 'airtime/om/BaseCcAccessPeer.php',
'BaseCcAccess' => 'airtime/om/BaseCcAccess.php', 'BaseCcAccess' => 'airtime/om/BaseCcAccess.php',
'BaseCcAccessQuery' => 'airtime/om/BaseCcAccessQuery.php', 'BaseCcAccessQuery' => 'airtime/om/BaseCcAccessQuery.php',
'CcBackupTableMap' => 'airtime/map/CcBackupTableMap.php',
'CcBackupPeer' => 'airtime/CcBackupPeer.php',
'CcBackup' => 'airtime/CcBackup.php',
'CcBackupQuery' => 'airtime/CcBackupQuery.php',
'BaseCcBackupPeer' => 'airtime/om/BaseCcBackupPeer.php',
'BaseCcBackup' => 'airtime/om/BaseCcBackup.php',
'BaseCcBackupQuery' => 'airtime/om/BaseCcBackupQuery.php',
'CcFilesTableMap' => 'airtime/map/CcFilesTableMap.php', 'CcFilesTableMap' => 'airtime/map/CcFilesTableMap.php',
'CcFilesPeer' => 'airtime/CcFilesPeer.php', 'CcFilesPeer' => 'airtime/CcFilesPeer.php',
'CcFiles' => 'airtime/CcFiles.php', 'CcFiles' => 'airtime/CcFiles.php',
@ -113,11 +106,4 @@ return array (
'BaseCcSubjsPeer' => 'airtime/om/BaseCcSubjsPeer.php', 'BaseCcSubjsPeer' => 'airtime/om/BaseCcSubjsPeer.php',
'BaseCcSubjs' => 'airtime/om/BaseCcSubjs.php', 'BaseCcSubjs' => 'airtime/om/BaseCcSubjs.php',
'BaseCcSubjsQuery' => 'airtime/om/BaseCcSubjsQuery.php', 'BaseCcSubjsQuery' => 'airtime/om/BaseCcSubjsQuery.php',
'CcTransTableMap' => 'airtime/map/CcTransTableMap.php',
'CcTransPeer' => 'airtime/CcTransPeer.php',
'CcTrans' => 'airtime/CcTrans.php',
'CcTransQuery' => 'airtime/CcTransQuery.php',
'BaseCcTransPeer' => 'airtime/om/BaseCcTransPeer.php',
'BaseCcTrans' => 'airtime/om/BaseCcTrans.php',
'BaseCcTransQuery' => 'airtime/om/BaseCcTransQuery.php',
); );

View File

@ -43,6 +43,9 @@ $CC_CONFIG = array(
'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A', 'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A',
'soundcloud-client-secret' => 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs', 'soundcloud-client-secret' => 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs',
'soundcloud-connection-retries' => $values['soundcloud']['connection_retries'],
'soundcloud-connection-wait' => $values['soundcloud']['time_between_retries'],
"rootDir" => __DIR__."/../..", "rootDir" => __DIR__."/../..",
'pearPath' => dirname(__FILE__).'/../../library/pear', 'pearPath' => dirname(__FILE__).'/../../library/pear',
'zendPath' => dirname(__FILE__).'/../../library/Zend', 'zendPath' => dirname(__FILE__).'/../../library/Zend',

View File

@ -282,7 +282,7 @@ class ApiController extends Zend_Controller_Action
if(Application_Model_Preference::GetDoSoundCloudUpload()) if(Application_Model_Preference::GetDoSoundCloudUpload())
{ {
for($i=0; $i<3; $i++) { for($i=0; $i<$CC_CONFIG['soundcloud-connection-retries']; $i++) {
$show = new Show($show_inst->getShowId()); $show = new Show($show_inst->getShowId());
$description = $show->getDescription(); $description = $show->getDescription();
@ -290,7 +290,8 @@ class ApiController extends Zend_Controller_Action
try { try {
$soundcloud = new ATSoundcloud(); $soundcloud = new ATSoundcloud();
$soundcloud->uploadTrack($file->getRealFilePath(), $file->getName(), $description, $hosts); $soundcloud_id = $soundcloud->uploadTrack($file->getRealFilePath(), $file->getName(), $description, $hosts);
$show_inst->setSoundCloudFileId($soundcloud_id);
break; break;
} }
catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) { catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
@ -300,7 +301,7 @@ class ApiController extends Zend_Controller_Action
} }
} }
sleep(60); sleep($CC_CONFIG['soundcloud-connection-wait']);
} }
} }

View File

@ -567,6 +567,19 @@ class ShowInstance {
return $showInstance->getDbEnds(); return $showInstance->getDbEnds();
} }
public function setSoundCloudFileId($p_soundcloud_id)
{
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
$showInstance->setDbSoundCloudId($p_soundcloud_id)
->save();
}
public function getSoundCloudFileId()
{
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
return $showInstance->getDbSoundCloudId();
}
public function setShowStart($start) public function setShowStart($start)
{ {
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId); $showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);

View File

@ -50,11 +50,12 @@ class ATSoundcloud {
); );
$response = json_decode( $response = json_decode(
$this->_soundcloud->post('tracks', $track_data), $this->_soundcloud->post('tracks', $track_data),
true true
); );
return $response["id"];
} }
} }

View File

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

View File

@ -74,6 +74,12 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
*/ */
protected $file_id; protected $file_id;
/**
* The value for the soundcloud_id field.
* @var int
*/
protected $soundcloud_id;
/** /**
* @var CcShow * @var CcShow
*/ */
@ -261,6 +267,16 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
return $this->file_id; return $this->file_id;
} }
/**
* Get the [soundcloud_id] column value.
*
* @return int
*/
public function getDbSoundCloudId()
{
return $this->soundcloud_id;
}
/** /**
* Set the value of [id] column. * Set the value of [id] column.
* *
@ -491,6 +507,26 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
return $this; return $this;
} // setDbRecordedFile() } // 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()
/** /**
* Indicates whether the columns in this object are only set to default values. * Indicates whether the columns in this object are only set to default values.
* *
@ -539,6 +575,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->rebroadcast = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; $this->rebroadcast = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
$this->instance_id = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : 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->file_id = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
$this->soundcloud_id = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
$this->resetModified(); $this->resetModified();
$this->setNew(false); $this->setNew(false);
@ -547,7 +584,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->ensureConsistency(); $this->ensureConsistency();
} }
return $startcol + 8; // 8 = CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS). return $startcol + 9; // 9 = CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating CcShowInstances object", $e); throw new PropelException("Error populating CcShowInstances object", $e);
@ -968,6 +1005,9 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
case 7: case 7:
return $this->getDbRecordedFile(); return $this->getDbRecordedFile();
break; break;
case 8:
return $this->getDbSoundCloudId();
break;
default: default:
return null; return null;
break; break;
@ -1000,6 +1040,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$keys[5] => $this->getDbRebroadcast(), $keys[5] => $this->getDbRebroadcast(),
$keys[6] => $this->getDbOriginalShow(), $keys[6] => $this->getDbOriginalShow(),
$keys[7] => $this->getDbRecordedFile(), $keys[7] => $this->getDbRecordedFile(),
$keys[8] => $this->getDbSoundCloudId(),
); );
if ($includeForeignObjects) { if ($includeForeignObjects) {
if (null !== $this->aCcShow) { if (null !== $this->aCcShow) {
@ -1066,6 +1107,9 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
case 7: case 7:
$this->setDbRecordedFile($value); $this->setDbRecordedFile($value);
break; break;
case 8:
$this->setDbSoundCloudId($value);
break;
} // switch() } // switch()
} }
@ -1098,6 +1142,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[5], $arr)) $this->setDbRebroadcast($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDbOriginalShow($arr[$keys[6]]); 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[7], $arr)) $this->setDbRecordedFile($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setDbSoundCloudId($arr[$keys[8]]);
} }
/** /**
@ -1117,6 +1162,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
if ($this->isColumnModified(CcShowInstancesPeer::REBROADCAST)) $criteria->add(CcShowInstancesPeer::REBROADCAST, $this->rebroadcast); 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::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::FILE_ID)) $criteria->add(CcShowInstancesPeer::FILE_ID, $this->file_id);
if ($this->isColumnModified(CcShowInstancesPeer::SOUNDCLOUD_ID)) $criteria->add(CcShowInstancesPeer::SOUNDCLOUD_ID, $this->soundcloud_id);
return $criteria; return $criteria;
} }
@ -1185,6 +1231,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$copyObj->setDbRebroadcast($this->rebroadcast); $copyObj->setDbRebroadcast($this->rebroadcast);
$copyObj->setDbOriginalShow($this->instance_id); $copyObj->setDbOriginalShow($this->instance_id);
$copyObj->setDbRecordedFile($this->file_id); $copyObj->setDbRecordedFile($this->file_id);
$copyObj->setDbSoundCloudId($this->soundcloud_id);
if ($deepCopy) { if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of // important: temporarily setNew(false) because this affects the behavior of
@ -1676,6 +1723,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->rebroadcast = null; $this->rebroadcast = null;
$this->instance_id = null; $this->instance_id = null;
$this->file_id = null; $this->file_id = null;
$this->soundcloud_id = null;
$this->alreadyInSave = false; $this->alreadyInSave = false;
$this->alreadyInValidation = false; $this->alreadyInValidation = false;
$this->clearAllReferences(); $this->clearAllReferences();

View File

@ -26,7 +26,7 @@ abstract class BaseCcShowInstancesPeer {
const TM_CLASS = 'CcShowInstancesTableMap'; const TM_CLASS = 'CcShowInstancesTableMap';
/** The total number of columns. */ /** The total number of columns. */
const NUM_COLUMNS = 8; const NUM_COLUMNS = 9;
/** The number of lazy-loaded columns. */ /** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0; const NUM_LAZY_LOAD_COLUMNS = 0;
@ -55,6 +55,9 @@ abstract class BaseCcShowInstancesPeer {
/** the column name for the FILE_ID field */ /** the column name for the FILE_ID field */
const FILE_ID = 'cc_show_instances.FILE_ID'; const FILE_ID = 'cc_show_instances.FILE_ID';
/** the column name for the SOUNDCLOUD_ID field */
const SOUNDCLOUD_ID = 'cc_show_instances.SOUNDCLOUD_ID';
/** /**
* An identiy map to hold any loaded instances of CcShowInstances objects. * An identiy map to hold any loaded instances of CcShowInstances objects.
* This must be public so that other peer classes can access this when hydrating from JOIN * This must be public so that other peer classes can access this when hydrating from JOIN
@ -71,12 +74,12 @@ abstract class BaseCcShowInstancesPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
private static $fieldNames = array ( private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', 'DbRecord', 'DbRebroadcast', 'DbOriginalShow', 'DbRecordedFile', ), BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', 'DbRecord', 'DbRebroadcast', 'DbOriginalShow', 'DbRecordedFile', 'DbSoundCloudId', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', 'dbRecord', 'dbRebroadcast', 'dbOriginalShow', 'dbRecordedFile', ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', 'dbRecord', 'dbRebroadcast', 'dbOriginalShow', 'dbRecordedFile', 'dbSoundCloudId', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::SHOW_ID, self::RECORD, self::REBROADCAST, self::INSTANCE_ID, self::FILE_ID, ), 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, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', 'RECORD', 'REBROADCAST', 'INSTANCE_ID', 'FILE_ID', ), BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', 'RECORD', 'REBROADCAST', 'INSTANCE_ID', 'FILE_ID', 'SOUNDCLOUD_ID', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', 'record', 'rebroadcast', 'instance_id', 'file_id', ), BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', 'record', 'rebroadcast', 'instance_id', 'file_id', 'soundcloud_id', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
); );
/** /**
@ -86,12 +89,12 @@ abstract class BaseCcShowInstancesPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/ */
private static $fieldKeys = array ( private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbShowId' => 3, 'DbRecord' => 4, 'DbRebroadcast' => 5, 'DbOriginalShow' => 6, 'DbRecordedFile' => 7, ), BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbShowId' => 3, 'DbRecord' => 4, 'DbRebroadcast' => 5, 'DbOriginalShow' => 6, 'DbRecordedFile' => 7, 'DbSoundCloudId' => 8, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, 'dbRecord' => 4, 'dbRebroadcast' => 5, 'dbOriginalShow' => 6, 'dbRecordedFile' => 7, ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, 'dbRecord' => 4, 'dbRebroadcast' => 5, 'dbOriginalShow' => 6, 'dbRecordedFile' => 7, 'dbSoundCloudId' => 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, ), 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, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'SHOW_ID' => 3, 'RECORD' => 4, 'REBROADCAST' => 5, 'INSTANCE_ID' => 6, 'FILE_ID' => 7, ), 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, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'show_id' => 3, 'record' => 4, 'rebroadcast' => 5, 'instance_id' => 6, 'file_id' => 7, ), 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, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
); );
/** /**
@ -171,6 +174,7 @@ abstract class BaseCcShowInstancesPeer {
$criteria->addSelectColumn(CcShowInstancesPeer::REBROADCAST); $criteria->addSelectColumn(CcShowInstancesPeer::REBROADCAST);
$criteria->addSelectColumn(CcShowInstancesPeer::INSTANCE_ID); $criteria->addSelectColumn(CcShowInstancesPeer::INSTANCE_ID);
$criteria->addSelectColumn(CcShowInstancesPeer::FILE_ID); $criteria->addSelectColumn(CcShowInstancesPeer::FILE_ID);
$criteria->addSelectColumn(CcShowInstancesPeer::SOUNDCLOUD_ID);
} else { } else {
$criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.STARTS'); $criteria->addSelectColumn($alias . '.STARTS');
@ -180,6 +184,7 @@ abstract class BaseCcShowInstancesPeer {
$criteria->addSelectColumn($alias . '.REBROADCAST'); $criteria->addSelectColumn($alias . '.REBROADCAST');
$criteria->addSelectColumn($alias . '.INSTANCE_ID'); $criteria->addSelectColumn($alias . '.INSTANCE_ID');
$criteria->addSelectColumn($alias . '.FILE_ID'); $criteria->addSelectColumn($alias . '.FILE_ID');
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_ID');
} }
} }

View File

@ -14,6 +14,7 @@
* @method CcShowInstancesQuery orderByDbRebroadcast($order = Criteria::ASC) Order by the rebroadcast column * @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 orderByDbOriginalShow($order = Criteria::ASC) Order by the instance_id column
* @method CcShowInstancesQuery orderByDbRecordedFile($order = Criteria::ASC) Order by the file_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 groupByDbId() Group by the id column * @method CcShowInstancesQuery groupByDbId() Group by the id column
* @method CcShowInstancesQuery groupByDbStarts() Group by the starts column * @method CcShowInstancesQuery groupByDbStarts() Group by the starts column
@ -23,6 +24,7 @@
* @method CcShowInstancesQuery groupByDbRebroadcast() Group by the rebroadcast column * @method CcShowInstancesQuery groupByDbRebroadcast() Group by the rebroadcast column
* @method CcShowInstancesQuery groupByDbOriginalShow() Group by the instance_id column * @method CcShowInstancesQuery groupByDbOriginalShow() Group by the instance_id column
* @method CcShowInstancesQuery groupByDbRecordedFile() Group by the file_id column * @method CcShowInstancesQuery groupByDbRecordedFile() Group by the file_id column
* @method CcShowInstancesQuery groupByDbSoundCloudId() Group by the soundcloud_id column
* *
* @method CcShowInstancesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query * @method CcShowInstancesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcShowInstancesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method CcShowInstancesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -59,6 +61,7 @@
* @method CcShowInstances findOneByDbRebroadcast(int $rebroadcast) Return the first CcShowInstances filtered by the rebroadcast column * @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 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 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 array findByDbId(int $id) Return CcShowInstances objects filtered by the id column * @method array findByDbId(int $id) Return CcShowInstances objects filtered by the id column
* @method array findByDbStarts(string $starts) Return CcShowInstances objects filtered by the starts column * @method array findByDbStarts(string $starts) Return CcShowInstances objects filtered by the starts column
@ -68,6 +71,7 @@
* @method array findByDbRebroadcast(int $rebroadcast) Return CcShowInstances objects filtered by the rebroadcast column * @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 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 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
* *
* @package propel.generator.airtime.om * @package propel.generator.airtime.om
*/ */
@ -411,6 +415,37 @@ abstract class BaseCcShowInstancesQuery extends ModelCriteria
return $this->addUsingAlias(CcShowInstancesPeer::FILE_ID, $dbRecordedFile, $comparison); 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 by a related CcShow object * Filter the query by a related CcShow object
* *

View File

@ -15,3 +15,7 @@ vhost = /
api_key = AAA api_key = AAA
webServerUser = www-data webServerUser = www-data
baseFilesDir = x baseFilesDir = x
[soundcloud]
connection_retries = 3
time_between_retries = 60

View File

@ -131,6 +131,7 @@
<column name="rebroadcast" phpName="DbRebroadcast" type="TINYINT" required="false" defaultValue="0"/> <column name="rebroadcast" phpName="DbRebroadcast" type="TINYINT" required="false" defaultValue="0"/>
<column name="instance_id" phpName="DbOriginalShow" type="INTEGER" required="false"/> <column name="instance_id" phpName="DbOriginalShow" type="INTEGER" required="false"/>
<column name="file_id" phpName="DbRecordedFile" type="INTEGER" required="false"/> <column name="file_id" phpName="DbRecordedFile" type="INTEGER" required="false"/>
<column name="soundcloud_id" phpName="DbSoundCloudId" type="INTEGER" required="false"/>
<foreign-key foreignTable="cc_show" name="cc_show_fkey" onDelete="CASCADE"> <foreign-key foreignTable="cc_show" name="cc_show_fkey" onDelete="CASCADE">
<reference local="show_id" foreign="id"/> <reference local="show_id" foreign="id"/>
</foreign-key> </foreign-key>

View File

@ -30,27 +30,6 @@ CREATE INDEX "cc_access_parent_idx" ON "cc_access" ("parent");
CREATE INDEX "cc_access_token_idx" ON "cc_access" ("token"); CREATE INDEX "cc_access_token_idx" ON "cc_access" ("token");
-----------------------------------------------------------------------------
-- cc_backup
-----------------------------------------------------------------------------
DROP TABLE "cc_backup" CASCADE;
CREATE TABLE "cc_backup"
(
"token" VARCHAR(64) NOT NULL,
"sessionid" VARCHAR(64) NOT NULL,
"status" VARCHAR(32) NOT NULL,
"fromtime" TIMESTAMP NOT NULL,
"totime" TIMESTAMP NOT NULL,
PRIMARY KEY ("token")
);
COMMENT ON TABLE "cc_backup" IS '';
SET search_path TO public;
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- cc_files -- cc_files
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
@ -190,6 +169,7 @@ CREATE TABLE "cc_show_instances"
"rebroadcast" INT2 default 0, "rebroadcast" INT2 default 0,
"instance_id" INTEGER, "instance_id" INTEGER,
"file_id" INTEGER, "file_id" INTEGER,
"soundcloud_id" INTEGER,
PRIMARY KEY ("id") PRIMARY KEY ("id")
); );
@ -440,53 +420,6 @@ COMMENT ON TABLE "cc_subjs" IS '';
SET search_path TO public; SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_trans
-----------------------------------------------------------------------------
DROP TABLE "cc_trans" CASCADE;
CREATE TABLE "cc_trans"
(
"id" serial NOT NULL,
"trtok" CHAR(16) NOT NULL,
"direction" VARCHAR(128) NOT NULL,
"state" VARCHAR(128) NOT NULL,
"trtype" VARCHAR(128) NOT NULL,
"lock" CHAR(1) default 'N' NOT NULL,
"target" VARCHAR(255),
"rtrtok" CHAR(16),
"mdtrtok" CHAR(16),
"gunid" CHAR(32),
"pdtoken" INT8,
"url" VARCHAR(255),
"localfile" VARCHAR(255),
"fname" VARCHAR(255),
"title" VARCHAR(255),
"expectedsum" CHAR(32),
"realsum" CHAR(32),
"expectedsize" INTEGER,
"realsize" INTEGER,
"uid" INTEGER,
"errmsg" VARCHAR(255),
"jobpid" INTEGER,
"start" TIMESTAMP,
"ts" TIMESTAMP,
PRIMARY KEY ("id"),
CONSTRAINT "cc_trans_id_idx" UNIQUE ("id"),
CONSTRAINT "cc_trans_token_idx" UNIQUE ("pdtoken"),
CONSTRAINT "cc_trans_trtok_idx" UNIQUE ("trtok")
);
COMMENT ON TABLE "cc_trans" IS '';
SET search_path TO public;
CREATE INDEX "cc_trans_gunid_idx" ON "cc_trans" ("gunid");
CREATE INDEX "cc_trans_state_idx" ON "cc_trans" ("state");
ALTER TABLE "cc_access" ADD CONSTRAINT "cc_access_owner_fkey" FOREIGN KEY ("owner") REFERENCES "cc_subjs" ("id"); ALTER TABLE "cc_access" ADD CONSTRAINT "cc_access_owner_fkey" FOREIGN KEY ("owner") REFERENCES "cc_subjs" ("id");
ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_editedby_fkey" FOREIGN KEY ("editedby") REFERENCES "cc_subjs" ("id"); ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_editedby_fkey" FOREIGN KEY ("editedby") REFERENCES "cc_subjs" ("id");