cleanup of function names

This commit is contained in:
Martin Konecny 2013-04-19 20:24:05 -04:00
parent 923f4ee180
commit fd78ad29bf
8 changed files with 23 additions and 31 deletions

View File

@ -113,7 +113,7 @@ class ApiController extends Zend_Controller_Action
$fileId = $this->_getParam("file");
$media = Application_Model_StoredFile::Recall($fileId);
$media = Application_Model_StoredFile::RecallById($fileId);
if ($media != null) {
$filepath = $media->getFilePath();
@ -387,7 +387,7 @@ class ApiController extends Zend_Controller_Action
$file_id = Application_Model_Schedule::GetFileId($media_id);
if (!is_null($file_id)) {
//we are dealing with a file not a stream
$file = Application_Model_StoredFile::Recall($file_id);
$file = Application_Model_StoredFile::RecallById($file_id);
$now = new DateTime("now", new DateTimeZone("UTC"));
$file->setLastPlayedTime($now);
}
@ -463,7 +463,7 @@ class ApiController extends Zend_Controller_Action
public function uploadRecordedActionParam($show_instance_id, $file_id)
{
$showCanceled = false;
$file = Application_Model_StoredFile::Recall($file_id);
$file = Application_Model_StoredFile::RecallById($file_id);
//$show_instance = $this->_getParam('show_instance');
try {
@ -979,7 +979,7 @@ class ApiController extends Zend_Controller_Action
foreach ($data as $pair) {
list($id, $gain) = $pair;
// TODO : move this code into model -- RG
$file = Application_Model_StoredFile::Recall($p_id = $id)->getPropelOrm();
$file = Application_Model_StoredFile::RecallById($p_id = $id)->getPropelOrm();
$file->setDbReplayGain($gain);
$file->save();
}
@ -1000,7 +1000,7 @@ class ApiController extends Zend_Controller_Action
foreach ($data as $pair) {
list($id, $info) = $pair;
// TODO : move this code into model -- RG
$file = Application_Model_StoredFile::Recall($p_id = $id)->getPropelOrm();
$file = Application_Model_StoredFile::RecallById($p_id = $id)->getPropelOrm();
//What we are doing here is setting a more accurate length that was
//calculated with silan by actually scanning the entire file. This

View File

@ -47,7 +47,7 @@ class AudiopreviewController extends Zend_Controller_Action
if ($type == "audioclip") {
$uri = $baseUrl."api/get-media/file/".$audioFileID;
$media = Application_Model_StoredFile::Recall($audioFileID);
$media = Application_Model_StoredFile::RecallById($audioFileID);
$mime = $media->getPropelOrm()->getDbMime();
} elseif ($type == "stream") {
$webstream = CcWebstreamQuery::create()->findPk($audioFileID);

View File

@ -177,7 +177,7 @@ class LibraryController extends Zend_Controller_Action
if ($type === "audioclip") {
$file = Application_Model_StoredFile::Recall($id);
$file = Application_Model_StoredFile::RecallById($id);
$menu["play"]["mime"] = $file->getPropelOrm()->getDbMime();
@ -335,7 +335,7 @@ class LibraryController extends Zend_Controller_Action
foreach ($files as $id) {
$file = Application_Model_StoredFile::Recall($id);
$file = Application_Model_StoredFile::RecallById($id);
if (isset($file)) {
try {
@ -407,7 +407,7 @@ class LibraryController extends Zend_Controller_Action
$request = $this->getRequest();
$file_id = $this->_getParam('id', null);
$file = Application_Model_StoredFile::Recall($file_id);
$file = Application_Model_StoredFile::RecallById($file_id);
if (!$isAdminOrPM && $file->getFileOwnerId() != $user->getId()) {
return;
@ -449,7 +449,7 @@ class LibraryController extends Zend_Controller_Action
try {
if ($type == "audioclip") {
$file = Application_Model_StoredFile::Recall($id);
$file = Application_Model_StoredFile::RecallById($id);
$this->view->type = $type;
$md = $file->getMetadata();
@ -533,7 +533,7 @@ class LibraryController extends Zend_Controller_Action
$this->view->error_code = $file->getSoundCloudErrorCode();
$this->view->error_msg = $file->getSoundCloudErrorMsg();
} elseif ($type == "file") {
$file = Application_Model_StoredFile::Recall($id);
$file = Application_Model_StoredFile::RecallById($id);
$this->view->sc_id = $file->getSoundCloudId();
$this->view->error_code = $file->getSoundCloudErrorCode();
$this->view->error_msg = $file->getSoundCloudErrorMsg();

View File

@ -931,7 +931,7 @@ class ScheduleController extends Zend_Controller_Action
$id = $this->_getParam('id');
$file_id = $this->_getParam('id', null);
$file = Application_Model_StoredFile::Recall($file_id);
$file = Application_Model_StoredFile::RecallById($file_id);
$baseUrl = $this->getRequest()->getBaseUrl();
$url = $file->getRelativeFileUrl($baseUrl).'download/true';

View File

@ -860,7 +860,7 @@ SQL;
if (!is_null($item['file_id'])) {
//row is from "file"
$media_id = $item['file_id'];
$storedFile = Application_Model_StoredFile::Recall($media_id);
$storedFile = Application_Model_StoredFile::RecallById($media_id);
$uri = $storedFile->getFilePath();
self::createFileScheduleEvent($data, $item, $media_id, $uri);
} elseif (!is_null($item['stream_id'])) {

View File

@ -202,8 +202,7 @@ class Application_Model_ShowBuilder
// at the time of creating on show, the recorded file is not in the DB yet.
// therefore, 'si_file_id' is null. So we need to check it.
if (Application_Model_Preference::GetUploadToSoundcloudOption() && isset($p_item['si_file_id'])) {
$file = Application_Model_StoredFile::Recall(
$p_item['si_file_id']);
$file = Application_Model_StoredFile::RecallById($p_item['si_file_id']);
if (isset($file)) {
$sid = $file->getSoundCloudId();
$row['soundcloud_id'] = $sid;

View File

@ -113,13 +113,13 @@ SQL;
public function setSoundCloudFileId($p_soundcloud_id)
{
$file = Application_Model_StoredFile::Recall($this->_showInstance->getDbRecordedFile());
$file = Application_Model_StoredFile::RecallById($this->_showInstance->getDbRecordedFile());
$file->setSoundCloudFileId($p_soundcloud_id);
}
public function getSoundCloudFileId()
{
$file = Application_Model_StoredFile::Recall($this->_showInstance->getDbRecordedFile());
$file = Application_Model_StoredFile::RecallById($this->_showInstance->getDbRecordedFile());
return $file->getSoundCloudId();
}
@ -129,7 +129,7 @@ SQL;
$file_id = $this->_showInstance->getDbRecordedFile();
if (isset($file_id)) {
$file = Application_Model_StoredFile::Recall($file_id);
$file = Application_Model_StoredFile::RecallById($file_id);
if (isset($file) && file_exists($file->getFilePath())) {
return $file;

View File

@ -343,7 +343,7 @@ SQL;
if (is_array($ids) && count($ids) > 0) {
return array_map( function ($id) {
return Application_Model_Playlist::Recall($id);
return Application_Model_Playlist::RecallById($id);
}, $ids);
} else {
return array();
@ -582,8 +582,7 @@ SQL;
return $storedFile;
}
public static function Recall($p_id=null, $p_gunid=null, $p_md5sum=null,
$p_filepath=null, $con=null) {
public static function RecallById($p_id=null, $con=null) {
//TODO
if (is_null($con)) {
@ -593,14 +592,8 @@ SQL;
if (isset($p_id)) {
$f = CcFilesQuery::create()->findPK(intval($p_id), $con);
return is_null($f) ? null : self::createWithFile($f, $con);
} elseif ( isset($p_gunid) ) {
throw new Exception("You should never use gunid ($gunid) anymore");
} elseif ( isset($p_md5sum) ) {
throw new Exception("Searching by md5($p_md5sum) is disabled");
} elseif ( isset($p_filepath) ) {
return is_null($f) ? null : Application_Model_StoredFile::RecallByFilepath($p_filepath, $con);
} else {
throw new Exception("No arguments passed to Recall");
throw new Exception("No arguments passed to RecallById");
}
}
@ -823,7 +816,7 @@ SQL;
$row['bit_rate'] = $formatter->format();
//soundcloud status
$file = Application_Model_StoredFile::Recall($row['id']);
$file = Application_Model_StoredFile::RecallById($row['id']);
$row['soundcloud_status'] = $file->getSoundCloudId();
// for audio preview
@ -1317,7 +1310,7 @@ SQL;
public static function setIsPlaylist($p_playlistItems, $p_type, $p_status) {
foreach ($p_playlistItems as $item) {
$file = self::Recall($item->getDbFileId());
$file = self::RecallById($item->getDbFileId());
$fileId = $file->_file->getDbId();
if ($p_type == 'playlist') {
// we have to check if the file is in another playlist before
@ -1339,7 +1332,7 @@ SQL;
} else {
$fileId = $p_fileId;
}
$file = self::Recall($fileId);
$file = self::RecallById($fileId);
$updateIsScheduled = false;
if (!is_null($fileId) && !in_array($fileId, Application_Model_Schedule::getAllFutureScheduledFiles())) {