CC-2562 : Allow users to convert linked files into watched directories
This commit is contained in:
parent
d3776f4ea9
commit
b89338e808
|
@ -18,7 +18,7 @@ class Version20110711161043 extends AbstractMigration
|
||||||
/* 1) update cc_files table to include to "directory" column */
|
/* 1) update cc_files table to include to "directory" column */
|
||||||
$this->_addSql("INSERT INTO cc_music_dirs (type, directory) VALUES ('stor', '/srv/airtime/stor');");
|
$this->_addSql("INSERT INTO cc_music_dirs (type, directory) VALUES ('stor', '/srv/airtime/stor');");
|
||||||
|
|
||||||
$this->_addSql("INSERT INTO cc_music_dirs (type, directory) VALUES ('upgrade', '');");
|
$this->_addSql("INSERT INTO cc_music_dirs (type, directory) VALUES ('link', '');");
|
||||||
|
|
||||||
$cc_music_dirs = $schema->getTable('cc_music_dirs');
|
$cc_music_dirs = $schema->getTable('cc_music_dirs');
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,9 @@ set_include_path(__DIR__.'/../../../airtime_mvc/library/pear' . PATH_SEPARATOR .
|
||||||
require_once 'conf.php';
|
require_once 'conf.php';
|
||||||
require_once 'DB.php';
|
require_once 'DB.php';
|
||||||
|
|
||||||
|
require_once 'propel/runtime/lib/Propel.php';
|
||||||
|
Propel::init(__DIR__."../../../airtime_mvc/application/configs/airtime-conf.php");
|
||||||
|
|
||||||
const CONF_DIR_BINARIES = "/usr/lib/airtime";
|
const CONF_DIR_BINARIES = "/usr/lib/airtime";
|
||||||
|
|
||||||
class AirtimeInstall{
|
class AirtimeInstall{
|
||||||
|
@ -462,7 +465,7 @@ class AirtimeIni{
|
||||||
AirtimeIni::CONF_FILE_LIQUIDSOAP);
|
AirtimeIni::CONF_FILE_LIQUIDSOAP);
|
||||||
|
|
||||||
// Backup the config files
|
// Backup the config files
|
||||||
$suffix = date("Ymdhis")."-1.8.1";
|
$suffix = date("Ymdhis")."-1.9.0";
|
||||||
foreach ($configFiles as $conf) {
|
foreach ($configFiles as $conf) {
|
||||||
if (file_exists($conf)) {
|
if (file_exists($conf)) {
|
||||||
echo "Backing up $conf to $conf$suffix.bak".PHP_EOL;
|
echo "Backing up $conf to $conf$suffix.bak".PHP_EOL;
|
||||||
|
@ -624,6 +627,20 @@ class Airtime190Upgrade{
|
||||||
echo $sql.PHP_EOL;
|
echo $sql.PHP_EOL;
|
||||||
Airtime190Upgrade::execSqlQuery($sql);
|
Airtime190Upgrade::execSqlQuery($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "Upgrading Linked Files".PHP_EOL;
|
||||||
|
|
||||||
|
//HANDLE LINKED FILES HERE.
|
||||||
|
|
||||||
|
$files = CcFilesQuery::create()
|
||||||
|
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||||
|
->filterByDbDirectory(NULL)
|
||||||
|
->find();
|
||||||
|
|
||||||
|
// You won't get a Fatal error for not enough memory with the following code
|
||||||
|
foreach($db_files as $db_file) {
|
||||||
|
echo $db_file->DbTrackTitle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue