Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
martin 2011-09-26 14:40:45 -04:00
commit 979a3fd414
8 changed files with 67 additions and 36 deletions

View File

@ -35,3 +35,7 @@ define('UI_MDATA_VALUE_FORMAT_STREAM', 'live stream');
// Session Keys
define('UI_PLAYLIST_SESSNAME', 'PLAYLIST');
// Soundcloud contants
define('SC_PROGRESS', -2);
define('SC_ERROR', -2);

View File

@ -413,7 +413,7 @@ class ApiController extends Zend_Controller_Action
$this->setSoundCloudErrorCode($code);
$this->setSoundCloudErrorMsg($msg);
// setting sc id to -3 which indicates error
$this->setSoundCloudFileId(-3);
$this->setSoundCloudFileId(SC_ERROR);
if(!in_array($code, array(0, 100))) {
break;
}

View File

@ -18,19 +18,6 @@ class Version20110829143306 extends AbstractMigration
$cc_stream_setting->setPrimaryKey(array('keyname'));
//end create cc_stream_setting table
// add soundcloud_id, soundcloud_error_code, soundcloud_error_msg columns to cc_files
$cc_files = $schema->getTable('cc_files');
$cc_files->addColumn('soundcloud_id', 'integer', array('notnull' => 0, 'default'=> NULL));
$cc_files->addColumn('soundcloud_error_code', 'integer', array('notnull' => 0, 'default'=> NULL));
$cc_files->addColumn('soundcloud_error_msg', 'string', array('length' => 255, 'notnull' => 0, 'default'=> NULL));
}
public function postUp(){
// move soundcloud_id from cc_show_instances to cc_files
$this->_addSql("update cc_files as cf set soundcloud_id = csi.soundcloud_id
from cc_show_instances as csi
where csi.file_id = cf.id and file_id is not NULL");
}
public function down(Schema $schema)

View File

@ -9,26 +9,11 @@ class Version20110922153933 extends AbstractMigration
{
public function up(Schema $schema)
{
// move soundcloud_id from cc_show_instances to cc_files
$this->_addSql("update cc_files as cf set soundcloud_id = csi.soundcloud_id
from cc_show_instances as csi
where csi.file_id = cf.id and file_id is not NULL");
// remove soundcloud_id from cc_show_instance table
$cc_show_instances = $schema->getTable('cc_show_instances');
$cc_show_instances->dropColumn('soundcloud_id');
// create cc_login_sttempts table
$cc_login = $schema->createTable('cc_login_attempts');
$cc_login->addColumn('ip', 'string', array('length' => 32));
$cc_login->addColumn('attempts', 'integer', array('notnull' => 0, 'default'=> 0));
$cc_login->setPrimaryKey(array('ip'));
// add login_attempts column to cc_subjs table
$cc_subjs = $schema->getTable('cc_subjs');
$cc_subjs->addColumn('login_attempts', 'integer', array('notnull' => 0, 'default'=> 0));
// add soundcloud_id, soundcloud_error_code, soundcloud_error_msg columns to cc_files
$cc_files = $schema->getTable('cc_files');
$cc_files->addColumn('soundcloud_id', 'integer', array('notnull' => 0, 'default'=> NULL));
$cc_files->addColumn('soundcloud_error_code', 'integer', array('notnull' => 0, 'default'=> NULL));
$cc_files->addColumn('soundcloud_error_msg', 'string', array('length' => 255, 'notnull' => 0, 'default'=> NULL));
}
public function down(Schema $schema)

View File

@ -0,0 +1,26 @@
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
class Version20110925171051 extends AbstractMigration
{
public function up(Schema $schema)
{
// move soundcloud_id from cc_show_instances to cc_files
$this->_addSql("update cc_files as cf set soundcloud_id = csi.soundcloud_id
from cc_show_instances as csi
where csi.file_id = cf.id and file_id is not NULL");
// remove soundcloud_id from cc_show_instance table
$cc_show_instances = $schema->getTable('cc_show_instances');
$cc_show_instances->dropColumn('soundcloud_id');
}
public function down(Schema $schema)
{
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
class Version20110925171256 extends AbstractMigration
{
public function up(Schema $schema)
{
// create cc_login_sttempts table
$cc_login = $schema->createTable('cc_login_attempts');
$cc_login->addColumn('ip', 'string', array('length' => 32));
$cc_login->addColumn('attempts', 'integer', array('notnull' => 0, 'default'=> 0));
$cc_login->setPrimaryKey(array('ip'));
// add login_attempts column to cc_subjs table
$cc_subjs = $schema->getTable('cc_subjs');
$cc_subjs->addColumn('login_attempts', 'integer', array('notnull' => 0, 'default'=> 0));
}
public function down(Schema $schema)
{
}
}

View File

@ -571,7 +571,7 @@ if(AirtimeInstall::DbTableExists('doctrine_migration_versions') === false) {
}
}
AirtimeInstall::MigrateTablesToVersion(__DIR__, '20110922153933');
AirtimeInstall::MigrateTablesToVersion(__DIR__, '20110925171256');
AirtimeInstall::SetDefaultStreamSetting();

View File

@ -60,6 +60,6 @@ if(count($argv) != 2){
$id = $argv[1];
$file = Application_Model_StoredFile::Recall($id);
// set id with -2 which is indicator for processing
$file->setSoundCloudFileId(-2);
$file->setSoundCloudFileId(SC_PROGRESS);
$file->uploadToSoundCloud();