CC-2977: Never delete files from the database

- using mtab(previous and current) files to figure out directories to be
added or removed
- adding index to cc_files
- see the tickets and media monitor design page for more info
This commit is contained in:
James 2012-01-12 17:55:05 -05:00
parent d5d4d50a9e
commit 08a09e4096
21 changed files with 297 additions and 220 deletions

View File

@ -574,13 +574,13 @@ class ApiController extends Zend_Controller_Action
}
else {
// path already exist
if($file->getFileExistFlag()){
if($file->getFileExistsFlag()){
// file marked as exists
$this->view->error = "File already exists in Airtime.";
return;
}else{
// file marked as not exists
$file->setFileExistFlag(true);
$file->setFileExistsFlag(true);
}
}
}
@ -831,46 +831,70 @@ class ApiController extends Zend_Controller_Action
}
$params = $request->getParams();
$temp_list = $params['mount_list'];
$mount_list = explode(',',$temp_list);
$added_list = empty($params['added_dir'])?array():explode(',',$params['added_dir']);
$removed_list = empty($params['removed_dir'])?array():explode(',',$params['removed_dir']);
// get all watched dirs
$dirs = Application_Model_MusicDir::getWatchedDirs(null, null);
$watched_dirs = Application_Model_MusicDir::getWatchedDirs(null,null);
// dirs to be added to watch list again
$addedDirs = array();
// dirs to be deleted from watch list
$removedDirs = array();
$tempDirs = Application_Model_MusicDir::getWatchedDirs(true,null);
foreach( $tempDirs as $d)
{
$removedDirs[$d->getDirectory()] = $d;
}
foreach( $dirs as $dir){
// set Exsits as false as default
foreach($mount_list as $mount_path){
if($mount_path == '/'){
continue;
}
// if dir contaions mount_path
if(strstr($dir->getDirectory(),$mount_path)){
if($dir->getExistsFlag() == false){
$addedDirs[] = $dir;
}else{
unset($removedDirs[$dir->getDirector()]);
foreach( $added_list as $ad){
foreach( $watched_dirs as $dir ){
$dirPath = $dir->getDirectory();
$ad .= '/';
// if mount path itself was watched
if($dirPath == $ad){
Application_Model_MusicDir::addWatchedDir($dirPath, false);
break;
}
// if dir contains any dir in removed_list( if watched dir resides on new mounted path )
else if(substr($dirPath, 0, strlen($ad)) === $ad && $dir->getExistsFlag() == false){
Application_Model_MusicDir::addWatchedDir($dirPath, false);
break;
}
// is new mount point within the watched dir?
// pyinotify doesn't notify anyhing in this case, so we add this mount point as
// watched dir
else if(substr($ad, 0, strlen($dirPath)) === $dirPath){
// bypass nested loop check
Application_Model_MusicDir::addWatchedDir($ad, false, true);
break;
}
}
}
}
foreach($addedDirs as $ad){
Application_Model_MusicDir::addWatchedDir($ad->getDirectory(), false);
}
foreach($removedDirs as $rd){
Application_Model_MusicDir::removeWatchedDir($rd->getDirectory(), false);
}
foreach( $removed_list as $rd){
foreach( $watched_dirs as $dir ){
$dirPath = $dir->getDirectory();
$rd .= '/';
// if dir contains any dir in removed_list( if watched dir resides on new mounted path )
if(substr($dirPath, 0, strlen($rd)) === $rd && $dir->getExistsFlag() == true){
Application_Model_MusicDir::removeWatchedDir($dirPath, false);
break;
}
// is new mount point within the watched dir?
// pyinotify doesn't notify anyhing in this case, so we walk through all files within
// this watched dir in DB and mark them deleted.
// In case of h) of use cases, due to pyinotify behaviour of noticing mounted dir, we need to
// compare agaisnt all files in cc_files table
else if(substr($rd, 0, strlen($dirPath)) === $dirPath ){
$watchDir = Application_Model_MusicDir::getDirByPath($rd);
// get all the files that is under $dirPath
$files = Application_Model_StoredFile::listAllFiles($dir->getId(), true);
foreach($files as $f){
// if the file is from this mount
if(substr( $f->getFilePath(),0,strlen($rd) ) === $rd){
$f->delete();
}
}
if($watchDir){
Application_Model_MusicDir::removeWatchedDir($rd, false);
}
break;
}
}
}
}
// handles case where watched dir is missing

View File

@ -226,7 +226,6 @@ class LibraryController extends Zend_Controller_Action
public function contentsAction()
{
$post = $this->getRequest()->getPost();
Logging::log(print_r($post, true));
$datatables = Application_Model_StoredFile::searchFilesForPlaylistBuilder($post);
//format clip lengh to 1 decimal

View File

@ -45,20 +45,30 @@ class Application_Model_MusicDir {
$this->_dir->save();
}
public function setRemovedFlag($flag){
$this->_dir->setRemoved($flag);
public function setWatchedFlag($flag){
$this->_dir->setWatched($flag);
$this->_dir->save();
}
public function getRemovedFlag(){
return $this->_dir->getRemoved();
public function getWatchedFlag(){
return $this->_dir->getWatched();
}
public function getExistsFlag(){
return $this->_dir->getExists();
}
public function remove($setRemovedFlag=true)
/** There are 2 cases where this function can be called.
* 1. When watched dir was removed
* 2. When some dir was watched, but it was unmounted
*
* In case of 1, $userAddedWatchedDir should be true
* In case of 2, $userAddedWatchedDir should be false
*
* When $userAddedWatchedDir is true, it will set "Watched" flag to false
* otherwise, it will set "Exists" flag to true
**/
public function remove($userAddedWatchedDir=true)
{
global $CC_DBC;
@ -77,13 +87,13 @@ class Application_Model_MusicDir {
foreach( $files as $file_row ){
$temp_file = Application_Model_StoredFile::Recall($file_row['id']);
if($temp_file != null){
$temp_file->setFileExistFlag(false);
$temp_file->setFileExistsFlag(false);
}
}
// set RemovedFlag to true
if($setRemovedFlag){
self::setRemovedFlag(true);
if($userAddedWatchedDir){
self::setWatchedFlag(false);
}else{
self::setExistsFlag(false);
}
@ -148,7 +158,19 @@ class Application_Model_MusicDir {
}
}
public static function addDir($p_path, $p_type, $setRemovedFlag=true)
/** There are 2 cases where this function can be called.
* 1. When watched dir was added
* 2. When some dir was watched, but it was unmounted somehow, but gets mounted again
*
* In case of 1, $userAddedWatchedDir should be true
* In case of 2, $userAddedWatchedDir should be false
*
* When $userAddedWatchedDir is true, it will set "Removed" flag to false
* otherwise, it will set "Exists" flag to true
*
* @param $nestedWatch - if true, bypass path check, and Watched to false
**/
public static function addDir($p_path, $p_type, $userAddedWatchedDir=true, $nestedWatch=false)
{
if(!is_dir($p_path)){
return array("code"=>2, "error"=>"'$p_path' is not a valid directory.");
@ -174,10 +196,15 @@ class Application_Model_MusicDir {
try {
/* isPathValid() checks if path is a substring or a superstring of an
* existing dir and if not, throws NestedDirectoryException */
self::isPathValid($p_path);
if($setRemovedFlag){
$dir->setRemovedFlag(false);
if(!$nestedWatch){
self::isPathValid($p_path);
}
if($userAddedWatchedDir){
$dir->setWatchedFlag(true);
}else{
if($nestedWatch){
$dir->setWatchedFlag(false);
}
$dir->setExistsFlag(true);
}
$dir->setDirectory($p_path);
@ -196,15 +223,15 @@ class Application_Model_MusicDir {
* 1. When watched dir was added
* 2. When some dir was watched, but it was unmounted somehow, but gets mounted again
*
* In case of 1, $setRemovedFlag should be true
* In case of 2, $setRemovedFlag should be false
* In case of 1, $userAddedWatchedDir should be true
* In case of 2, $userAddedWatchedDir should be false
*
* When $setRemovedFlag is true, it will set "Removed" flag to false
* When $userAddedWatchedDir is true, it will set "Watched" flag to true
* otherwise, it will set "Exists" flag to true
**/
public static function addWatchedDir($p_path, $setRemovedFlag=true)
public static function addWatchedDir($p_path, $userAddedWatchedDir=true, $nestedWatch=false)
{
$res = self::addDir($p_path, "watched", $setRemovedFlag);
$res = self::addDir($p_path, "watched", $userAddedWatchedDir, $nestedWatch);
if ($res['code'] == 0){
@ -266,7 +293,6 @@ class Application_Model_MusicDir {
$dir = CcMusicDirsQuery::create()
->filterByDirectory($p_path)
->findOne();
if($dir == NULL){
return null;
}
@ -280,9 +306,9 @@ class Application_Model_MusicDir {
* Search and returns watched dirs
*
* @param $exists search condition with exists flag
* @param $removed search condition with removed flag
* @param $watched search condition with watched flag
*/
public static function getWatchedDirs($exists=true, $removed=false)
public static function getWatchedDirs($exists=true, $watched=true)
{
$result = array();
@ -291,8 +317,8 @@ class Application_Model_MusicDir {
if($exists !== null){
$dirs = $dirs->filterByExists($exists);
}
if($removed !== null){
$dirs = $dirs->filterByRemoved($removed);
if($watched !== null){
$dirs = $dirs->filterByWatched($watched);
}
$dirs = $dirs->find();
@ -359,23 +385,22 @@ class Application_Model_MusicDir {
* 1. When watched dir was removed
* 2. When some dir was watched, but it was unmounted
*
* In case of 1, $setRemovedFlag should be true
* In case of 2, $setRemovedFlag should be false
* In case of 1, $userAddedWatchedDir should be true
* In case of 2, $userAddedWatchedDir should be false
*
* When $setRemovedFlag is true, it will set "Removed" flag to false
* When $userAddedWatchedDir is true, it will set "Watched" flag to false
* otherwise, it will set "Exists" flag to true
**/
public static function removeWatchedDir($p_dir, $setRemovedFlag=true){
public static function removeWatchedDir($p_dir, $userAddedWatchedDir=true){
$real_path = realpath($p_dir)."/";
if($real_path != "/"){
$p_dir = $real_path;
}
$dir = Application_Model_MusicDir::getDirByPath($p_dir);
if($dir == NULL){
return array("code"=>1,"error"=>"'$p_dir' doesn't exist in the watched list.");
}else{
$dir->remove($setRemovedFlag);
$dir->remove($userAddedWatchedDir);
$data = array();
$data["directory"] = $p_dir;
Application_Model_RabbitMq::SendMessageToMediaMonitor("remove_watch", $data);

View File

@ -317,8 +317,8 @@ class Application_Model_StoredFile {
// don't delete from the playslist. We might want to put a flag
//Application_Model_Playlist::DeleteFileFromAllPlaylists($this->getId());
// set file_exist falg to false
$this->_file->setDbFileExist(false);
// set file_exists falg to false
$this->_file->setDbFileExists(false);
$this->_file->save();
//$this->_file->delete();
@ -683,7 +683,7 @@ class Application_Model_StoredFile {
FROM ".$CC_CONFIG["playListTable"]." AS PL
LEFT JOIN ".$CC_CONFIG['playListTimeView']." AS PLT USING(id))
UNION
(".$fileSelect."id FROM ".$CC_CONFIG["filesTable"]." AS FILES WHERE file_exist = 'TRUE')) AS RESULTS";
(".$fileSelect."id FROM ".$CC_CONFIG["filesTable"]." AS FILES WHERE file_exists = 'TRUE')) AS RESULTS";
return Application_Model_StoredFile::searchFiles($fromTable, $datatables);
}
@ -754,9 +754,6 @@ class Application_Model_StoredFile {
$orderby = join("," , $orderby);
// End Order By clause
//ordered by integer as expected by datatables.
//$CC_DBC->setFetchMode(DB_FETCHMODE_ORDERED);
if(isset($where)) {
$where = join(" AND ", $where);
$sql = $selectorCount." FROM ".$fromTable." WHERE ".$where;
@ -770,21 +767,13 @@ class Application_Model_StoredFile {
$results = $CC_DBC->getAll($sql);
foreach($results as &$row){
// add checkbox row
$row['checkbox'] = "<input type='checkbox' name='cb_".$row[id]."'>";
$row['checkbox'] = "<input type='checkbox' name='cb_".$row['id']."'>";
// a full timestamp is being returned for playlists' year column;
// split it and grab only the year info
$yearSplit = explode('-', $row['year']);
$row['year'] = $yearSplit[0];
}
//$results['checkbox']
//$results = $CC_DBC->getAssoc($sql);
Logging::log(print_r($results, true));
//echo $results;
//echo $sql;
//put back to default fetch mode.
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
if(!isset($totalDisplayRows)) {
$totalDisplayRows = $totalRows;
@ -929,24 +918,34 @@ class Application_Model_StoredFile {
return $CC_DBC->GetOne($sql);
}
public static function listAllFiles($dir_id){
/**
*
* Enter description here ...
* @param $dir_id - if this is not provided, it returns all files with full path constructed.
* @param $propelObj - if this is true, it returns array of proepl obj
*/
public static function listAllFiles($dir_id=null, $propelObj=false){
global $CC_DBC;
// $sql = "SELECT m.directory || '/' || f.filepath as fp"
// ." FROM CC_MUSIC_DIRS m"
// ." LEFT JOIN CC_FILES f"
// ." ON m.id = f.directory"
// ." WHERE m.id = f.directory"
// ." AND m.id = $dir_id";
$sql = "SELECT filepath as fp"
." FROM CC_FILES"
." WHERE directory = $dir_id";
if($propelObj){
$sql = "SELECT m.directory || f.filepath as fp"
." FROM CC_MUSIC_DIRS m"
." LEFT JOIN CC_FILES f"
." ON m.id = f.directory WHERE m.id = $dir_id and f.file_exists = 'TRUE'";
}else{
$sql = "SELECT filepath as fp"
." FROM CC_FILES"
." WHERE directory = $dir_id and file_exists = 'TRUE'";
}
$rows = $CC_DBC->getAll($sql);
$results = array();
foreach ($rows as $row){
$results[] = $row["fp"];
if($propelObj){
$results[] = Application_Model_StoredFile::RecallByFilepath($row["fp"]);
}else{
$results[] = $row["fp"];
}
}
return $results;
@ -990,13 +989,13 @@ class Application_Model_StoredFile {
return $this->_file->getDbSoundCloudErrorMsg();
}
public function setFileExistFlag($flag){
$this->_file->setDbFileExist($flag)
public function setFileExistsFlag($flag){
$this->_file->setDbFileExists($flag)
->save();
}
public function getFileExistFlag(){
return $this->_file->getDbFileExist();
public function getFileExistsFlag(){
return $this->_file->getDbFileExists();
}
public function uploadToSoundCloud()

View File

@ -95,7 +95,7 @@ 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('FILE_EXIST', 'DbFileExist', 'BOOLEAN', false, null, true);
$this->addColumn('FILE_EXISTS', 'DbFileExists', 'BOOLEAN', false, null, true);
$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);

View File

@ -42,7 +42,7 @@ class CcMusicDirsTableMap extends TableMap {
$this->addColumn('DIRECTORY', 'Directory', 'LONGVARCHAR', false, null, null);
$this->addColumn('TYPE', 'Type', 'VARCHAR', false, 255, null);
$this->addColumn('EXISTS', 'Exists', 'BOOLEAN', false, null, true);
$this->addColumn('REMOVED', 'Removed', 'BOOLEAN', false, null, false);
$this->addColumn('WATCHED', 'Watched', 'BOOLEAN', false, null, true);
// validators
} // initialize()

View File

@ -373,11 +373,11 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
protected $language;
/**
* The value for the file_exist field.
* The value for the file_exists field.
* Note: this column has a database default value of: true
* @var boolean
*/
protected $file_exist;
protected $file_exists;
/**
* The value for the soundcloud_id field.
@ -456,7 +456,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->filepath = '';
$this->state = 'empty';
$this->currentlyaccessing = 0;
$this->file_exist = true;
$this->file_exists = true;
}
/**
@ -1132,13 +1132,13 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
}
/**
* Get the [file_exist] column value.
* Get the [file_exists] column value.
*
* @return boolean
*/
public function getDbFileExist()
public function getDbFileExists()
{
return $this->file_exist;
return $this->file_exists;
}
/**
@ -2446,24 +2446,24 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
} // setDbLanguage()
/**
* Set the value of [file_exist] column.
* Set the value of [file_exists] column.
*
* @param boolean $v new value
* @return CcFiles The current object (for fluent API support)
*/
public function setDbFileExist($v)
public function setDbFileExists($v)
{
if ($v !== null) {
$v = (boolean) $v;
}
if ($this->file_exist !== $v || $this->isNew()) {
$this->file_exist = $v;
$this->modifiedColumns[] = CcFilesPeer::FILE_EXIST;
if ($this->file_exists !== $v || $this->isNew()) {
$this->file_exists = $v;
$this->modifiedColumns[] = CcFilesPeer::FILE_EXISTS;
}
return $this;
} // setDbFileExist()
} // setDbFileExists()
/**
* Set the value of [soundcloud_id] column.
@ -2579,7 +2579,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return false;
}
if ($this->file_exist !== true) {
if ($this->file_exists !== true) {
return false;
}
@ -2662,7 +2662,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->subject = ($row[$startcol + 54] !== null) ? (string) $row[$startcol + 54] : null;
$this->contributor = ($row[$startcol + 55] !== null) ? (string) $row[$startcol + 55] : null;
$this->language = ($row[$startcol + 56] !== null) ? (string) $row[$startcol + 56] : null;
$this->file_exist = ($row[$startcol + 57] !== null) ? (boolean) $row[$startcol + 57] : null;
$this->file_exists = ($row[$startcol + 57] !== null) ? (boolean) $row[$startcol + 57] : null;
$this->soundcloud_id = ($row[$startcol + 58] !== null) ? (int) $row[$startcol + 58] : null;
$this->soundcloud_error_code = ($row[$startcol + 59] !== null) ? (int) $row[$startcol + 59] : null;
$this->soundcloud_error_msg = ($row[$startcol + 60] !== null) ? (string) $row[$startcol + 60] : null;
@ -3245,7 +3245,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this->getDbLanguage();
break;
case 57:
return $this->getDbFileExist();
return $this->getDbFileExists();
break;
case 58:
return $this->getDbSoundcloudId();
@ -3340,7 +3340,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$keys[54] => $this->getDbSubject(),
$keys[55] => $this->getDbContributor(),
$keys[56] => $this->getDbLanguage(),
$keys[57] => $this->getDbFileExist(),
$keys[57] => $this->getDbFileExists(),
$keys[58] => $this->getDbSoundcloudId(),
$keys[59] => $this->getDbSoundcloudErrorCode(),
$keys[60] => $this->getDbSoundcloudErrorMsg(),
@ -3556,7 +3556,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->setDbLanguage($value);
break;
case 57:
$this->setDbFileExist($value);
$this->setDbFileExists($value);
break;
case 58:
$this->setDbSoundcloudId($value);
@ -3651,7 +3651,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if (array_key_exists($keys[54], $arr)) $this->setDbSubject($arr[$keys[54]]);
if (array_key_exists($keys[55], $arr)) $this->setDbContributor($arr[$keys[55]]);
if (array_key_exists($keys[56], $arr)) $this->setDbLanguage($arr[$keys[56]]);
if (array_key_exists($keys[57], $arr)) $this->setDbFileExist($arr[$keys[57]]);
if (array_key_exists($keys[57], $arr)) $this->setDbFileExists($arr[$keys[57]]);
if (array_key_exists($keys[58], $arr)) $this->setDbSoundcloudId($arr[$keys[58]]);
if (array_key_exists($keys[59], $arr)) $this->setDbSoundcloudErrorCode($arr[$keys[59]]);
if (array_key_exists($keys[60], $arr)) $this->setDbSoundcloudErrorMsg($arr[$keys[60]]);
@ -3724,7 +3724,7 @@ 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::FILE_EXIST)) $criteria->add(CcFilesPeer::FILE_EXIST, $this->file_exist);
if ($this->isColumnModified(CcFilesPeer::FILE_EXISTS)) $criteria->add(CcFilesPeer::FILE_EXISTS, $this->file_exists);
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);
@ -3846,7 +3846,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$copyObj->setDbSubject($this->subject);
$copyObj->setDbContributor($this->contributor);
$copyObj->setDbLanguage($this->language);
$copyObj->setDbFileExist($this->file_exist);
$copyObj->setDbFileExists($this->file_exists);
$copyObj->setDbSoundcloudId($this->soundcloud_id);
$copyObj->setDbSoundcloudErrorCode($this->soundcloud_error_code);
$copyObj->setDbSoundcloudErrorMsg($this->soundcloud_error_msg);
@ -4507,7 +4507,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->subject = null;
$this->contributor = null;
$this->language = null;
$this->file_exist = null;
$this->file_exists = null;
$this->soundcloud_id = null;
$this->soundcloud_error_code = null;
$this->soundcloud_error_msg = null;

View File

@ -202,8 +202,8 @@ abstract class BaseCcFilesPeer {
/** the column name for the LANGUAGE field */
const LANGUAGE = 'cc_files.LANGUAGE';
/** the column name for the FILE_EXIST field */
const FILE_EXIST = 'cc_files.FILE_EXIST';
/** the column name for the FILE_EXISTS field */
const FILE_EXISTS = 'cc_files.FILE_EXISTS';
/** the column name for the SOUNDCLOUD_ID field */
const SOUNDCLOUD_ID = 'cc_files.SOUNDCLOUD_ID';
@ -233,11 +233,11 @@ 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', 'DbUtime', 'DbLPtime', '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', 'DbFileExist', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', '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', 'dbFileExist', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', ),
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::UTIME, self::LPTIME, 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::FILE_EXIST, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', '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', 'FILE_EXIST', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', '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', 'file_exist', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', ),
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbGunid', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', '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', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', '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', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', ),
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::UTIME, self::LPTIME, 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::FILE_EXISTS, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', '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', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', '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', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', ),
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, 58, 59, 60, 61, )
);
@ -248,11 +248,11 @@ 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, 'DbUtime' => 11, 'DbLPtime' => 12, 'DbMd5' => 13, 'DbTrackTitle' => 14, 'DbArtistName' => 15, 'DbBitRate' => 16, 'DbSampleRate' => 17, 'DbFormat' => 18, 'DbLength' => 19, 'DbAlbumTitle' => 20, 'DbGenre' => 21, 'DbComments' => 22, 'DbYear' => 23, 'DbTrackNumber' => 24, 'DbChannels' => 25, 'DbUrl' => 26, 'DbBpm' => 27, 'DbRating' => 28, 'DbEncodedBy' => 29, 'DbDiscNumber' => 30, 'DbMood' => 31, 'DbLabel' => 32, 'DbComposer' => 33, 'DbEncoder' => 34, 'DbChecksum' => 35, 'DbLyrics' => 36, 'DbOrchestra' => 37, 'DbConductor' => 38, 'DbLyricist' => 39, 'DbOriginalLyricist' => 40, 'DbRadioStationName' => 41, 'DbInfoUrl' => 42, 'DbArtistUrl' => 43, 'DbAudioSourceUrl' => 44, 'DbRadioStationUrl' => 45, 'DbBuyThisUrl' => 46, 'DbIsrcNumber' => 47, 'DbCatalogNumber' => 48, 'DbOriginalArtist' => 49, 'DbCopyright' => 50, 'DbReportDatetime' => 51, 'DbReportLocation' => 52, 'DbReportOrganization' => 53, 'DbSubject' => 54, 'DbContributor' => 55, 'DbLanguage' => 56, 'DbFileExist' => 57, 'DbSoundcloudId' => 58, 'DbSoundcloudErrorCode' => 59, 'DbSoundcloudErrorMsg' => 60, 'DbSoundcloudLinkToFile' => 61, ),
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, 'dbUtime' => 11, 'dbLPtime' => 12, 'dbMd5' => 13, 'dbTrackTitle' => 14, 'dbArtistName' => 15, 'dbBitRate' => 16, 'dbSampleRate' => 17, 'dbFormat' => 18, 'dbLength' => 19, 'dbAlbumTitle' => 20, 'dbGenre' => 21, 'dbComments' => 22, 'dbYear' => 23, 'dbTrackNumber' => 24, 'dbChannels' => 25, 'dbUrl' => 26, 'dbBpm' => 27, 'dbRating' => 28, 'dbEncodedBy' => 29, 'dbDiscNumber' => 30, 'dbMood' => 31, 'dbLabel' => 32, 'dbComposer' => 33, 'dbEncoder' => 34, 'dbChecksum' => 35, 'dbLyrics' => 36, 'dbOrchestra' => 37, 'dbConductor' => 38, 'dbLyricist' => 39, 'dbOriginalLyricist' => 40, 'dbRadioStationName' => 41, 'dbInfoUrl' => 42, 'dbArtistUrl' => 43, 'dbAudioSourceUrl' => 44, 'dbRadioStationUrl' => 45, 'dbBuyThisUrl' => 46, 'dbIsrcNumber' => 47, 'dbCatalogNumber' => 48, 'dbOriginalArtist' => 49, 'dbCopyright' => 50, 'dbReportDatetime' => 51, 'dbReportLocation' => 52, 'dbReportOrganization' => 53, 'dbSubject' => 54, 'dbContributor' => 55, 'dbLanguage' => 56, 'dbFileExist' => 57, 'dbSoundcloudId' => 58, 'dbSoundcloudErrorCode' => 59, 'dbSoundcloudErrorMsg' => 60, 'dbSoundcloudLinkToFile' => 61, ),
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::UTIME => 11, self::LPTIME => 12, self::MD5 => 13, self::TRACK_TITLE => 14, self::ARTIST_NAME => 15, self::BIT_RATE => 16, self::SAMPLE_RATE => 17, self::FORMAT => 18, self::LENGTH => 19, self::ALBUM_TITLE => 20, self::GENRE => 21, self::COMMENTS => 22, self::YEAR => 23, self::TRACK_NUMBER => 24, self::CHANNELS => 25, self::URL => 26, self::BPM => 27, self::RATING => 28, self::ENCODED_BY => 29, self::DISC_NUMBER => 30, self::MOOD => 31, self::LABEL => 32, self::COMPOSER => 33, self::ENCODER => 34, self::CHECKSUM => 35, self::LYRICS => 36, self::ORCHESTRA => 37, self::CONDUCTOR => 38, self::LYRICIST => 39, self::ORIGINAL_LYRICIST => 40, self::RADIO_STATION_NAME => 41, self::INFO_URL => 42, self::ARTIST_URL => 43, self::AUDIO_SOURCE_URL => 44, self::RADIO_STATION_URL => 45, self::BUY_THIS_URL => 46, self::ISRC_NUMBER => 47, self::CATALOG_NUMBER => 48, self::ORIGINAL_ARTIST => 49, self::COPYRIGHT => 50, self::REPORT_DATETIME => 51, self::REPORT_LOCATION => 52, self::REPORT_ORGANIZATION => 53, self::SUBJECT => 54, self::CONTRIBUTOR => 55, self::LANGUAGE => 56, self::FILE_EXIST => 57, self::SOUNDCLOUD_ID => 58, self::SOUNDCLOUD_ERROR_CODE => 59, self::SOUNDCLOUD_ERROR_MSG => 60, self::SOUNDCLOUD_LINK_TO_FILE => 61, ),
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, 'UTIME' => 11, 'LPTIME' => 12, 'MD5' => 13, 'TRACK_TITLE' => 14, 'ARTIST_NAME' => 15, 'BIT_RATE' => 16, 'SAMPLE_RATE' => 17, 'FORMAT' => 18, 'LENGTH' => 19, 'ALBUM_TITLE' => 20, 'GENRE' => 21, 'COMMENTS' => 22, 'YEAR' => 23, 'TRACK_NUMBER' => 24, 'CHANNELS' => 25, 'URL' => 26, 'BPM' => 27, 'RATING' => 28, 'ENCODED_BY' => 29, 'DISC_NUMBER' => 30, 'MOOD' => 31, 'LABEL' => 32, 'COMPOSER' => 33, 'ENCODER' => 34, 'CHECKSUM' => 35, 'LYRICS' => 36, 'ORCHESTRA' => 37, 'CONDUCTOR' => 38, 'LYRICIST' => 39, 'ORIGINAL_LYRICIST' => 40, 'RADIO_STATION_NAME' => 41, 'INFO_URL' => 42, 'ARTIST_URL' => 43, 'AUDIO_SOURCE_URL' => 44, 'RADIO_STATION_URL' => 45, 'BUY_THIS_URL' => 46, 'ISRC_NUMBER' => 47, 'CATALOG_NUMBER' => 48, 'ORIGINAL_ARTIST' => 49, 'COPYRIGHT' => 50, 'REPORT_DATETIME' => 51, 'REPORT_LOCATION' => 52, 'REPORT_ORGANIZATION' => 53, 'SUBJECT' => 54, 'CONTRIBUTOR' => 55, 'LANGUAGE' => 56, 'FILE_EXIST' => 57, 'SOUNDCLOUD_ID' => 58, 'SOUNDCLOUD_ERROR_CODE' => 59, 'SOUNDCLOUD_ERROR_MSG' => 60, 'SOUNDCLOUD_LINK_TO_FILE' => 61, ),
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, 'utime' => 11, 'lptime' => 12, 'md5' => 13, 'track_title' => 14, 'artist_name' => 15, 'bit_rate' => 16, 'sample_rate' => 17, 'format' => 18, 'length' => 19, 'album_title' => 20, 'genre' => 21, 'comments' => 22, 'year' => 23, 'track_number' => 24, 'channels' => 25, 'url' => 26, 'bpm' => 27, 'rating' => 28, 'encoded_by' => 29, 'disc_number' => 30, 'mood' => 31, 'label' => 32, 'composer' => 33, 'encoder' => 34, 'checksum' => 35, 'lyrics' => 36, 'orchestra' => 37, 'conductor' => 38, 'lyricist' => 39, 'original_lyricist' => 40, 'radio_station_name' => 41, 'info_url' => 42, 'artist_url' => 43, 'audio_source_url' => 44, 'radio_station_url' => 45, 'buy_this_url' => 46, 'isrc_number' => 47, 'catalog_number' => 48, 'original_artist' => 49, 'copyright' => 50, 'report_datetime' => 51, 'report_location' => 52, 'report_organization' => 53, 'subject' => 54, 'contributor' => 55, 'language' => 56, 'file_exist' => 57, 'soundcloud_id' => 58, 'soundcloud_error_code' => 59, 'soundcloud_error_msg' => 60, 'soundcloud_link_to_file' => 61, ),
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, 'DbUtime' => 11, 'DbLPtime' => 12, 'DbMd5' => 13, 'DbTrackTitle' => 14, 'DbArtistName' => 15, 'DbBitRate' => 16, 'DbSampleRate' => 17, 'DbFormat' => 18, 'DbLength' => 19, 'DbAlbumTitle' => 20, 'DbGenre' => 21, 'DbComments' => 22, 'DbYear' => 23, 'DbTrackNumber' => 24, 'DbChannels' => 25, 'DbUrl' => 26, 'DbBpm' => 27, 'DbRating' => 28, 'DbEncodedBy' => 29, 'DbDiscNumber' => 30, 'DbMood' => 31, 'DbLabel' => 32, 'DbComposer' => 33, 'DbEncoder' => 34, 'DbChecksum' => 35, 'DbLyrics' => 36, 'DbOrchestra' => 37, 'DbConductor' => 38, 'DbLyricist' => 39, 'DbOriginalLyricist' => 40, 'DbRadioStationName' => 41, 'DbInfoUrl' => 42, 'DbArtistUrl' => 43, 'DbAudioSourceUrl' => 44, 'DbRadioStationUrl' => 45, 'DbBuyThisUrl' => 46, 'DbIsrcNumber' => 47, 'DbCatalogNumber' => 48, 'DbOriginalArtist' => 49, 'DbCopyright' => 50, 'DbReportDatetime' => 51, 'DbReportLocation' => 52, 'DbReportOrganization' => 53, 'DbSubject' => 54, 'DbContributor' => 55, 'DbLanguage' => 56, 'DbFileExists' => 57, 'DbSoundcloudId' => 58, 'DbSoundcloudErrorCode' => 59, 'DbSoundcloudErrorMsg' => 60, 'DbSoundcloudLinkToFile' => 61, ),
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, 'dbUtime' => 11, 'dbLPtime' => 12, 'dbMd5' => 13, 'dbTrackTitle' => 14, 'dbArtistName' => 15, 'dbBitRate' => 16, 'dbSampleRate' => 17, 'dbFormat' => 18, 'dbLength' => 19, 'dbAlbumTitle' => 20, 'dbGenre' => 21, 'dbComments' => 22, 'dbYear' => 23, 'dbTrackNumber' => 24, 'dbChannels' => 25, 'dbUrl' => 26, 'dbBpm' => 27, 'dbRating' => 28, 'dbEncodedBy' => 29, 'dbDiscNumber' => 30, 'dbMood' => 31, 'dbLabel' => 32, 'dbComposer' => 33, 'dbEncoder' => 34, 'dbChecksum' => 35, 'dbLyrics' => 36, 'dbOrchestra' => 37, 'dbConductor' => 38, 'dbLyricist' => 39, 'dbOriginalLyricist' => 40, 'dbRadioStationName' => 41, 'dbInfoUrl' => 42, 'dbArtistUrl' => 43, 'dbAudioSourceUrl' => 44, 'dbRadioStationUrl' => 45, 'dbBuyThisUrl' => 46, 'dbIsrcNumber' => 47, 'dbCatalogNumber' => 48, 'dbOriginalArtist' => 49, 'dbCopyright' => 50, 'dbReportDatetime' => 51, 'dbReportLocation' => 52, 'dbReportOrganization' => 53, 'dbSubject' => 54, 'dbContributor' => 55, 'dbLanguage' => 56, 'dbFileExists' => 57, 'dbSoundcloudId' => 58, 'dbSoundcloudErrorCode' => 59, 'dbSoundcloudErrorMsg' => 60, 'dbSoundcloudLinkToFile' => 61, ),
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::UTIME => 11, self::LPTIME => 12, self::MD5 => 13, self::TRACK_TITLE => 14, self::ARTIST_NAME => 15, self::BIT_RATE => 16, self::SAMPLE_RATE => 17, self::FORMAT => 18, self::LENGTH => 19, self::ALBUM_TITLE => 20, self::GENRE => 21, self::COMMENTS => 22, self::YEAR => 23, self::TRACK_NUMBER => 24, self::CHANNELS => 25, self::URL => 26, self::BPM => 27, self::RATING => 28, self::ENCODED_BY => 29, self::DISC_NUMBER => 30, self::MOOD => 31, self::LABEL => 32, self::COMPOSER => 33, self::ENCODER => 34, self::CHECKSUM => 35, self::LYRICS => 36, self::ORCHESTRA => 37, self::CONDUCTOR => 38, self::LYRICIST => 39, self::ORIGINAL_LYRICIST => 40, self::RADIO_STATION_NAME => 41, self::INFO_URL => 42, self::ARTIST_URL => 43, self::AUDIO_SOURCE_URL => 44, self::RADIO_STATION_URL => 45, self::BUY_THIS_URL => 46, self::ISRC_NUMBER => 47, self::CATALOG_NUMBER => 48, self::ORIGINAL_ARTIST => 49, self::COPYRIGHT => 50, self::REPORT_DATETIME => 51, self::REPORT_LOCATION => 52, self::REPORT_ORGANIZATION => 53, self::SUBJECT => 54, self::CONTRIBUTOR => 55, self::LANGUAGE => 56, self::FILE_EXISTS => 57, self::SOUNDCLOUD_ID => 58, self::SOUNDCLOUD_ERROR_CODE => 59, self::SOUNDCLOUD_ERROR_MSG => 60, self::SOUNDCLOUD_LINK_TO_FILE => 61, ),
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, 'UTIME' => 11, 'LPTIME' => 12, 'MD5' => 13, 'TRACK_TITLE' => 14, 'ARTIST_NAME' => 15, 'BIT_RATE' => 16, 'SAMPLE_RATE' => 17, 'FORMAT' => 18, 'LENGTH' => 19, 'ALBUM_TITLE' => 20, 'GENRE' => 21, 'COMMENTS' => 22, 'YEAR' => 23, 'TRACK_NUMBER' => 24, 'CHANNELS' => 25, 'URL' => 26, 'BPM' => 27, 'RATING' => 28, 'ENCODED_BY' => 29, 'DISC_NUMBER' => 30, 'MOOD' => 31, 'LABEL' => 32, 'COMPOSER' => 33, 'ENCODER' => 34, 'CHECKSUM' => 35, 'LYRICS' => 36, 'ORCHESTRA' => 37, 'CONDUCTOR' => 38, 'LYRICIST' => 39, 'ORIGINAL_LYRICIST' => 40, 'RADIO_STATION_NAME' => 41, 'INFO_URL' => 42, 'ARTIST_URL' => 43, 'AUDIO_SOURCE_URL' => 44, 'RADIO_STATION_URL' => 45, 'BUY_THIS_URL' => 46, 'ISRC_NUMBER' => 47, 'CATALOG_NUMBER' => 48, 'ORIGINAL_ARTIST' => 49, 'COPYRIGHT' => 50, 'REPORT_DATETIME' => 51, 'REPORT_LOCATION' => 52, 'REPORT_ORGANIZATION' => 53, 'SUBJECT' => 54, 'CONTRIBUTOR' => 55, 'LANGUAGE' => 56, 'FILE_EXISTS' => 57, 'SOUNDCLOUD_ID' => 58, 'SOUNDCLOUD_ERROR_CODE' => 59, 'SOUNDCLOUD_ERROR_MSG' => 60, 'SOUNDCLOUD_LINK_TO_FILE' => 61, ),
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, 'utime' => 11, 'lptime' => 12, 'md5' => 13, 'track_title' => 14, 'artist_name' => 15, 'bit_rate' => 16, 'sample_rate' => 17, 'format' => 18, 'length' => 19, 'album_title' => 20, 'genre' => 21, 'comments' => 22, 'year' => 23, 'track_number' => 24, 'channels' => 25, 'url' => 26, 'bpm' => 27, 'rating' => 28, 'encoded_by' => 29, 'disc_number' => 30, 'mood' => 31, 'label' => 32, 'composer' => 33, 'encoder' => 34, 'checksum' => 35, 'lyrics' => 36, 'orchestra' => 37, 'conductor' => 38, 'lyricist' => 39, 'original_lyricist' => 40, 'radio_station_name' => 41, 'info_url' => 42, 'artist_url' => 43, 'audio_source_url' => 44, 'radio_station_url' => 45, 'buy_this_url' => 46, 'isrc_number' => 47, 'catalog_number' => 48, 'original_artist' => 49, 'copyright' => 50, 'report_datetime' => 51, 'report_location' => 52, 'report_organization' => 53, 'subject' => 54, 'contributor' => 55, 'language' => 56, 'file_exists' => 57, 'soundcloud_id' => 58, 'soundcloud_error_code' => 59, 'soundcloud_error_msg' => 60, 'soundcloud_link_to_file' => 61, ),
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, 58, 59, 60, 61, )
);
@ -382,7 +382,7 @@ abstract class BaseCcFilesPeer {
$criteria->addSelectColumn(CcFilesPeer::SUBJECT);
$criteria->addSelectColumn(CcFilesPeer::CONTRIBUTOR);
$criteria->addSelectColumn(CcFilesPeer::LANGUAGE);
$criteria->addSelectColumn(CcFilesPeer::FILE_EXIST);
$criteria->addSelectColumn(CcFilesPeer::FILE_EXISTS);
$criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ID);
$criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ERROR_CODE);
$criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ERROR_MSG);
@ -445,7 +445,7 @@ abstract class BaseCcFilesPeer {
$criteria->addSelectColumn($alias . '.SUBJECT');
$criteria->addSelectColumn($alias . '.CONTRIBUTOR');
$criteria->addSelectColumn($alias . '.LANGUAGE');
$criteria->addSelectColumn($alias . '.FILE_EXIST');
$criteria->addSelectColumn($alias . '.FILE_EXISTS');
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_ID');
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_ERROR_CODE');
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_ERROR_MSG');

View File

@ -63,7 +63,7 @@
* @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 orderByDbFileExist($order = Criteria::ASC) Order by the file_exist column
* @method CcFilesQuery orderByDbFileExists($order = Criteria::ASC) Order by the file_exists 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
@ -126,7 +126,7 @@
* @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 groupByDbFileExist() Group by the file_exist column
* @method CcFilesQuery groupByDbFileExists() Group by the file_exists 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
@ -216,7 +216,7 @@
* @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 findOneByDbFileExist(boolean $file_exist) Return the first CcFiles filtered by the file_exist column
* @method CcFiles findOneByDbFileExists(boolean $file_exists) Return the first CcFiles filtered by the file_exists 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
@ -279,7 +279,7 @@
* @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 findByDbFileExist(boolean $file_exist) Return CcFiles objects filtered by the file_exist column
* @method array findByDbFileExists(boolean $file_exists) Return CcFiles objects filtered by the file_exists 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
@ -1724,20 +1724,20 @@ abstract class BaseCcFilesQuery extends ModelCriteria
}
/**
* Filter the query on the file_exist column
* Filter the query on the file_exists column
*
* @param boolean|string $dbFileExist The value to use as filter.
* @param boolean|string $dbFileExists The value to use as filter.
* Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcFilesQuery The current query, for fluid interface
*/
public function filterByDbFileExist($dbFileExist = null, $comparison = null)
public function filterByDbFileExists($dbFileExists = null, $comparison = null)
{
if (is_string($dbFileExist)) {
$file_exist = in_array(strtolower($dbFileExist), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
if (is_string($dbFileExists)) {
$file_exists = in_array(strtolower($dbFileExists), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
}
return $this->addUsingAlias(CcFilesPeer::FILE_EXIST, $dbFileExist, $comparison);
return $this->addUsingAlias(CcFilesPeer::FILE_EXISTS, $dbFileExists, $comparison);
}
/**

View File

@ -50,11 +50,11 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
protected $exists;
/**
* The value for the removed field.
* Note: this column has a database default value of: false
* The value for the watched field.
* Note: this column has a database default value of: true
* @var boolean
*/
protected $removed;
protected $watched;
/**
* @var array CcFiles[] Collection to store aggregation of CcFiles objects.
@ -84,7 +84,7 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
public function applyDefaultValues()
{
$this->exists = true;
$this->removed = false;
$this->watched = true;
}
/**
@ -138,13 +138,13 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
}
/**
* Get the [removed] column value.
* Get the [watched] column value.
*
* @return boolean
*/
public function getRemoved()
public function getWatched()
{
return $this->removed;
return $this->watched;
}
/**
@ -228,24 +228,24 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
} // setExists()
/**
* Set the value of [removed] column.
* Set the value of [watched] column.
*
* @param boolean $v new value
* @return CcMusicDirs The current object (for fluent API support)
*/
public function setRemoved($v)
public function setWatched($v)
{
if ($v !== null) {
$v = (boolean) $v;
}
if ($this->removed !== $v || $this->isNew()) {
$this->removed = $v;
$this->modifiedColumns[] = CcMusicDirsPeer::REMOVED;
if ($this->watched !== $v || $this->isNew()) {
$this->watched = $v;
$this->modifiedColumns[] = CcMusicDirsPeer::WATCHED;
}
return $this;
} // setRemoved()
} // setWatched()
/**
* Indicates whether the columns in this object are only set to default values.
@ -261,7 +261,7 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
return false;
}
if ($this->removed !== false) {
if ($this->watched !== true) {
return false;
}
@ -291,7 +291,7 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
$this->directory = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->type = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->exists = ($row[$startcol + 3] !== null) ? (boolean) $row[$startcol + 3] : null;
$this->removed = ($row[$startcol + 4] !== null) ? (boolean) $row[$startcol + 4] : null;
$this->watched = ($row[$startcol + 4] !== null) ? (boolean) $row[$startcol + 4] : null;
$this->resetModified();
$this->setNew(false);
@ -630,7 +630,7 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
return $this->getExists();
break;
case 4:
return $this->getRemoved();
return $this->getWatched();
break;
default:
return null;
@ -659,7 +659,7 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
$keys[1] => $this->getDirectory(),
$keys[2] => $this->getType(),
$keys[3] => $this->getExists(),
$keys[4] => $this->getRemoved(),
$keys[4] => $this->getWatched(),
);
return $result;
}
@ -704,7 +704,7 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
$this->setExists($value);
break;
case 4:
$this->setRemoved($value);
$this->setWatched($value);
break;
} // switch()
}
@ -734,7 +734,7 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
if (array_key_exists($keys[1], $arr)) $this->setDirectory($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setType($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setExists($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setRemoved($arr[$keys[4]]);
if (array_key_exists($keys[4], $arr)) $this->setWatched($arr[$keys[4]]);
}
/**
@ -750,7 +750,7 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
if ($this->isColumnModified(CcMusicDirsPeer::DIRECTORY)) $criteria->add(CcMusicDirsPeer::DIRECTORY, $this->directory);
if ($this->isColumnModified(CcMusicDirsPeer::TYPE)) $criteria->add(CcMusicDirsPeer::TYPE, $this->type);
if ($this->isColumnModified(CcMusicDirsPeer::EXISTS)) $criteria->add(CcMusicDirsPeer::EXISTS, $this->exists);
if ($this->isColumnModified(CcMusicDirsPeer::REMOVED)) $criteria->add(CcMusicDirsPeer::REMOVED, $this->removed);
if ($this->isColumnModified(CcMusicDirsPeer::WATCHED)) $criteria->add(CcMusicDirsPeer::WATCHED, $this->watched);
return $criteria;
}
@ -815,7 +815,7 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
$copyObj->setDirectory($this->directory);
$copyObj->setType($this->type);
$copyObj->setExists($this->exists);
$copyObj->setRemoved($this->removed);
$copyObj->setWatched($this->watched);
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
@ -1016,7 +1016,7 @@ abstract class BaseCcMusicDirs extends BaseObject implements Persistent
$this->directory = null;
$this->type = null;
$this->exists = null;
$this->removed = null;
$this->watched = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->clearAllReferences();

View File

@ -43,8 +43,8 @@ abstract class BaseCcMusicDirsPeer {
/** the column name for the EXISTS field */
const EXISTS = 'cc_music_dirs.EXISTS';
/** the column name for the REMOVED field */
const REMOVED = 'cc_music_dirs.REMOVED';
/** the column name for the WATCHED field */
const WATCHED = 'cc_music_dirs.WATCHED';
/**
* An identiy map to hold any loaded instances of CcMusicDirs objects.
@ -62,11 +62,11 @@ abstract class BaseCcMusicDirsPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Directory', 'Type', 'Exists', 'Removed', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'directory', 'type', 'exists', 'removed', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::DIRECTORY, self::TYPE, self::EXISTS, self::REMOVED, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'DIRECTORY', 'TYPE', 'EXISTS', 'REMOVED', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'directory', 'type', 'exists', 'removed', ),
BasePeer::TYPE_PHPNAME => array ('Id', 'Directory', 'Type', 'Exists', 'Watched', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'directory', 'type', 'exists', 'watched', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::DIRECTORY, self::TYPE, self::EXISTS, self::WATCHED, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'DIRECTORY', 'TYPE', 'EXISTS', 'WATCHED', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'directory', 'type', 'exists', 'watched', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
);
@ -77,11 +77,11 @@ abstract class BaseCcMusicDirsPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Directory' => 1, 'Type' => 2, 'Exists' => 3, 'Removed' => 4, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, 'exists' => 3, 'removed' => 4, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::DIRECTORY => 1, self::TYPE => 2, self::EXISTS => 3, self::REMOVED => 4, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'DIRECTORY' => 1, 'TYPE' => 2, 'EXISTS' => 3, 'REMOVED' => 4, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, 'exists' => 3, 'removed' => 4, ),
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Directory' => 1, 'Type' => 2, 'Exists' => 3, 'Watched' => 4, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, 'exists' => 3, 'watched' => 4, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::DIRECTORY => 1, self::TYPE => 2, self::EXISTS => 3, self::WATCHED => 4, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'DIRECTORY' => 1, 'TYPE' => 2, 'EXISTS' => 3, 'WATCHED' => 4, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, 'exists' => 3, 'watched' => 4, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
);
@ -158,13 +158,13 @@ abstract class BaseCcMusicDirsPeer {
$criteria->addSelectColumn(CcMusicDirsPeer::DIRECTORY);
$criteria->addSelectColumn(CcMusicDirsPeer::TYPE);
$criteria->addSelectColumn(CcMusicDirsPeer::EXISTS);
$criteria->addSelectColumn(CcMusicDirsPeer::REMOVED);
$criteria->addSelectColumn(CcMusicDirsPeer::WATCHED);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.DIRECTORY');
$criteria->addSelectColumn($alias . '.TYPE');
$criteria->addSelectColumn($alias . '.EXISTS');
$criteria->addSelectColumn($alias . '.REMOVED');
$criteria->addSelectColumn($alias . '.WATCHED');
}
}

View File

@ -10,13 +10,13 @@
* @method CcMusicDirsQuery orderByDirectory($order = Criteria::ASC) Order by the directory column
* @method CcMusicDirsQuery orderByType($order = Criteria::ASC) Order by the type column
* @method CcMusicDirsQuery orderByExists($order = Criteria::ASC) Order by the exists column
* @method CcMusicDirsQuery orderByRemoved($order = Criteria::ASC) Order by the removed column
* @method CcMusicDirsQuery orderByWatched($order = Criteria::ASC) Order by the watched column
*
* @method CcMusicDirsQuery groupById() Group by the id column
* @method CcMusicDirsQuery groupByDirectory() Group by the directory column
* @method CcMusicDirsQuery groupByType() Group by the type column
* @method CcMusicDirsQuery groupByExists() Group by the exists column
* @method CcMusicDirsQuery groupByRemoved() Group by the removed column
* @method CcMusicDirsQuery groupByWatched() Group by the watched column
*
* @method CcMusicDirsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcMusicDirsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -33,13 +33,13 @@
* @method CcMusicDirs findOneByDirectory(string $directory) Return the first CcMusicDirs filtered by the directory column
* @method CcMusicDirs findOneByType(string $type) Return the first CcMusicDirs filtered by the type column
* @method CcMusicDirs findOneByExists(boolean $exists) Return the first CcMusicDirs filtered by the exists column
* @method CcMusicDirs findOneByRemoved(boolean $removed) Return the first CcMusicDirs filtered by the removed column
* @method CcMusicDirs findOneByWatched(boolean $watched) Return the first CcMusicDirs filtered by the watched column
*
* @method array findById(int $id) Return CcMusicDirs objects filtered by the id column
* @method array findByDirectory(string $directory) Return CcMusicDirs objects filtered by the directory column
* @method array findByType(string $type) Return CcMusicDirs objects filtered by the type column
* @method array findByExists(boolean $exists) Return CcMusicDirs objects filtered by the exists column
* @method array findByRemoved(boolean $removed) Return CcMusicDirs objects filtered by the removed column
* @method array findByWatched(boolean $watched) Return CcMusicDirs objects filtered by the watched column
*
* @package propel.generator.airtime.om
*/
@ -228,20 +228,20 @@ abstract class BaseCcMusicDirsQuery extends ModelCriteria
}
/**
* Filter the query on the removed column
* Filter the query on the watched column
*
* @param boolean|string $removed The value to use as filter.
* @param boolean|string $watched The value to use as filter.
* Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcMusicDirsQuery The current query, for fluid interface
*/
public function filterByRemoved($removed = null, $comparison = null)
public function filterByWatched($watched = null, $comparison = null)
{
if (is_string($removed)) {
$removed = in_array(strtolower($removed), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
if (is_string($watched)) {
$watched = in_array(strtolower($watched), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
}
return $this->addUsingAlias(CcMusicDirsPeer::REMOVED, $removed, $comparison);
return $this->addUsingAlias(CcMusicDirsPeer::WATCHED, $watched, $comparison);
}
/**

View File

@ -33,12 +33,12 @@
</ul>
<?php endif; ?>
</dd>
<?php $watched_dirs = Application_Model_MusicDir::getWatchedDirs(null, false); ?>
<?php $watched_dirs = Application_Model_MusicDir::getWatchedDirs(null, true); ?>
<?php if (count($watched_dirs) > 0): ?>
<?php foreach($watched_dirs as $watched_dir): ?>
<dd class="block-display selected-item">
<span><?php echo $watched_dir->getDirectory(); echo " -- Exsits? "; echo ($watched_dir->getExistsFlag())?"YES":"NO";?></span><span class="ui-icon ui-icon-close"></span>
<span><?php echo "< Exists? "; echo ($watched_dir->getExistsFlag())?"YES > : ":"NO > : ";?></span><span><?php echo $watched_dir->getDirectory();?></span></span><span class="ui-icon ui-icon-close"></span>
</dd>
<?php endforeach; ?>
<?php else: ?>

View File

@ -17,7 +17,7 @@ if (count($items)) : ?>
</div>
<div class="text-row">
<span class="spl_artist"><?php echo $item["CcFiles"]['artist_name'] ?></span>
<span class="spl_artist"><?php echo ($item["CcFiles"]['file_exist'])?"":"NO FILE FOUND!" ?></span>
<span class="spl_artist"><?php echo ($item["CcFiles"]['file_exists'])?"":"NO FILE FOUND!" ?></span>
<span class="spl_offset"><?php echo $item["offset"]?></span>
</div>
<?php //create the crossfade icon.

View File

@ -29,7 +29,7 @@
<column name="directory" phpName="Directory" type="LONGVARCHAR" required="false"/>
<column name="type" phpName="Type" type="VARCHAR" size="255" required="false"/>
<column name="exists" phpName="Exists" type="BOOLEAN" required="false" defaultValue="true"/>
<column name="removed" phpName="Removed" type="BOOLEAN" required="false" defaultValue="false"/>
<column name="watched" phpName="Watched" type="BOOLEAN" required="false" defaultValue="true"/>
<unique name="cc_music_dir_unique">
<unique-column name="directory"/>
</unique>
@ -92,7 +92,7 @@
<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="file_exist" phpName="DbFileExist" type="BOOLEAN" required="false" defaultValue="true"/>
<column name="file_exists" phpName="DbFileExists" type="BOOLEAN" required="false" defaultValue="true"/>
<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"/>
@ -112,6 +112,9 @@
<index name="cc_files_name_idx">
<index-column name="name"/>
</index>
<index name="cc_files_file_exists_idx">
<index-column name="file_exists"/>
</index>
</table>
<table name="cc_perms" phpName="CcPerms">
<column name="permid" phpName="Permid" type="INTEGER" primaryKey="true" required="true"/>

View File

@ -43,7 +43,7 @@ CREATE TABLE "cc_music_dirs"
"directory" TEXT,
"type" VARCHAR(255),
"exists" BOOLEAN default 't',
"removed" BOOLEAN default 'f',
"watched" BOOLEAN default 't',
PRIMARY KEY ("id"),
CONSTRAINT "cc_music_dir_unique" UNIQUE ("directory")
);
@ -118,7 +118,7 @@ CREATE TABLE "cc_files"
"subject" VARCHAR(512),
"contributor" VARCHAR(512),
"language" VARCHAR(512),
"file_exist" BOOLEAN default 't',
"file_exists" BOOLEAN default 't',
"soundcloud_id" INTEGER,
"soundcloud_error_code" INTEGER,
"soundcloud_error_msg" VARCHAR(512),
@ -135,6 +135,8 @@ CREATE INDEX "cc_files_md5_idx" ON "cc_files" ("md5");
CREATE INDEX "cc_files_name_idx" ON "cc_files" ("name");
CREATE INDEX "cc_files_file_exists_idx" ON "cc_files" ("file_exists");
-----------------------------------------------------------------------------
-- cc_perms
-----------------------------------------------------------------------------

View File

@ -592,15 +592,18 @@ class AirTimeApiClient(ApiClientInterface):
"""
This function updates status of mounted file system information on airtime
"""
def update_file_system_mount(self, mount_list):
def update_file_system_mount(self, added_dir, removed_dir):
logger = logging.getLogger()
try:
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["update_fs_mount"])
url = url.replace("%%api_key%%", self.config["api_key"])
data_string = string.join(mount_list, ',')
map = [("mount_list", data_string)]
added_data_string = string.join(added_dir, ',')
removed_data_string = string.join(removed_dir, ',')
map = [("added_dir", added_data_string),("removed_dir",removed_data_string)]
data = urllib.urlencode(map)
req = urllib2.Request(url, data)
@ -614,7 +617,7 @@ class AirTimeApiClient(ApiClientInterface):
"""
When watched dir is missing(unplugged or something) on boot up, this function will get called
and will call approperiate function on Airtime.
and will call appropriate function on Airtime.
"""
def handle_watched_dir_missing(self, dir):
logger = logging.getLogger()

View File

@ -1,6 +1,7 @@
import os
import time
import pyinotify
import shutil
from subprocess import Popen, PIPE
from api_clients import api_client
@ -22,8 +23,13 @@ class AirtimeMediaMonitorBootstrap():
self.wm = wm
# add /etc on watch list so we can detect mount
self.mount_file = "/etc"
self.curr_mtab_file = "/var/tmp/airtime/media-monitor/currMtab"
self.logger.info("Adding %s on watch list...", self.mount_file)
self.wm.add_watch(self.mount_file, pyinotify.ALL_EVENTS, rec=False, auto_add=False)
# create currMtab file if it's the first time
if not os.path.exists(self.curr_mtab_file):
shutil.copy('/etc/mtab', self.curr_mtab_file)
"""On bootup we want to scan all directories and look for files that
weren't there or files that changed before media-monitor process

View File

@ -2,6 +2,8 @@ import socket
import logging
import time
import os
import shutil
import difflib
import pyinotify
from pyinotify import ProcessEvent
@ -40,6 +42,8 @@ class AirtimeProcessEvent(ProcessEvent):
self.create_dict = {}
self.mount_file_dir = "/etc";
self.mount_file = "/etc/mtab";
self.curr_mtab_file = "/var/tmp/airtime/media-monitor/currMtab"
self.prev_mtab_file = "/var/tmp/airtime/media-monitor/prevMtab"
def add_filepath_to_ignore(self, filepath):
self.ignore_event.add(filepath)
@ -167,23 +171,33 @@ class AirtimeProcessEvent(ProcessEvent):
# if change is detected on /etc/mtab, we check what mount(file system) was added/removed
# and act accordingly
def handle_mount_change(self):
mount_list = [];
# parse /etc/mtab
fh = open(self.mount_file, 'r')
while 1:
line = fh.readline()
if not line:
break
line_info = line.split(' ')
# the line format is like following:
# /dev/sdg1 /media/809D-D2A1 vfat rw,nosuid,nodev,uhelper=udisks..........
# so we always get [1] after split to get the mount point
mount_list.append(line_info[1])
fh.close()
self.logger.info("Mount List: %s", mount_list)
self.logger.info("Mount change detected, handling changes...");
# take snapshot of mtab file and update currMtab and prevMtab
# move currMtab to prevMtab and create new currMtab
shutil.move(self.curr_mtab_file, self.prev_mtab_file)
# create the file
shutil.copy(self.mount_file, self.curr_mtab_file)
d = difflib.Differ()
curr_fh = open(self.curr_mtab_file, 'r')
prev_fh = open(self.prev_mtab_file, 'r')
diff = list(d.compare(prev_fh.readlines(), curr_fh.readlines()))
added_mount_points = []
removed_mount_points = []
for dir in diff:
info = dir.split(' ')
if info[0] == '+':
added_mount_points.append(info[2])
elif info[0] == '-':
removed_mount_points.append(info[2])
self.logger.info("added: %s", added_mount_points)
self.logger.info("removed: %s", removed_mount_points)
# send current mount information to Airtime
self.api_client.update_file_system_mount(mount_list);
self.api_client.update_file_system_mount(added_mount_points, removed_mount_points);
def handle_watched_dir_missing(self, dir):
self.api_client.handle_watched_dir_missing(dir);

View File

@ -10,7 +10,7 @@ import pyinotify
class MediaMonitorCommon:
timestamp_file = "/var/tmp/airtime/last_index"
timestamp_file = "/var/tmp/airtime/media-monitor/last_index"
def __init__(self, airtime_config, wm=None):
self.supported_file_formats = ['mp3', 'ogg']

View File

@ -6,7 +6,9 @@ if os.geteuid() != 0:
sys.exit(1)
try:
#create media-monitor dir under /var/tmp/airtime
if not os.path.exists("/var/tmp/airtime/media-monitor"):
os.makedirs("/var/tmp/airtime/media-monitor")
if os.environ["disable_auto_start_services"] == "f":
#update-rc.d init script
p = Popen("update-rc.d airtime-media-monitor defaults >/dev/null 2>&1", shell=True)